Add routes for basic app structure
This commit is contained in:
parent
aca94c1ec9
commit
1c53af9215
14
index.js
14
index.js
|
@ -19,7 +19,10 @@ let app = restify.createServer({
|
|||
|
||||
function createServer () {
|
||||
app.get('/', index)
|
||||
app.all('/frame', rFrame)
|
||||
app.get('/frame', rFrame)
|
||||
app.post('/frame', rFrame)
|
||||
app.get('/sequence', () => {})
|
||||
app.post('/sequence', () => {})
|
||||
app.get('/status', rStatus)
|
||||
app.listen(PORT, () => {
|
||||
console.log(`${APPNAME} listening on port ${PORT}!`)
|
||||
|
@ -32,16 +35,11 @@ function rFrame (req, res, next) {
|
|||
}
|
||||
|
||||
function rStatus (req, res, next) {
|
||||
const obj = status()
|
||||
res.send(obj)
|
||||
const obj = intval.status()
|
||||
res.send({})
|
||||
return next()
|
||||
}
|
||||
|
||||
function status () {
|
||||
const obj = {}
|
||||
return obj
|
||||
}
|
||||
|
||||
function index (req, res, next) {
|
||||
res.end(INDEX)
|
||||
return next()
|
||||
|
|
|
@ -16,6 +16,9 @@ class Intval {
|
|||
}
|
||||
})
|
||||
}
|
||||
status () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Intval()
|
Loading…
Reference in New Issue