repl.it
@Kognise/

DuckoTest

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
require('express')()
  .get('/', (req, res) => res.send('GET /:status'))
  .get('/:status', (req, res) => {
    if (req.params.status.length !== 3) {
      res.sendStatus(400)
    } else {
      res.sendStatus(parseInt(req.params.status))
      res.contentType('application/javascript')
      res.send(`window.status_${req.params.status} = true`)
    }
  })
  .listen(3000, () => console.log('> Listening'))
?