Add routes for basic app structure

This commit is contained in:
mmcwilliams 2017-08-22 00:00:24 -04:00
parent aca94c1ec9
commit 1c53af9215
2 changed files with 9 additions and 8 deletions

View File

@ -19,7 +19,10 @@ let app = restify.createServer({
function createServer () { function createServer () {
app.get('/', index) 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.get('/status', rStatus)
app.listen(PORT, () => { app.listen(PORT, () => {
console.log(`${APPNAME} listening on port ${PORT}!`) console.log(`${APPNAME} listening on port ${PORT}!`)
@ -32,16 +35,11 @@ function rFrame (req, res, next) {
} }
function rStatus (req, res, next) { function rStatus (req, res, next) {
const obj = status() const obj = intval.status()
res.send(obj) res.send({})
return next() return next()
} }
function status () {
const obj = {}
return obj
}
function index (req, res, next) { function index (req, res, next) {
res.end(INDEX) res.end(INDEX)
return next() return next()

View File

@ -16,6 +16,9 @@ class Intval {
} }
}) })
} }
status () {
return {}
}
} }
module.exports = new Intval() module.exports = new Intval()