Last active
August 29, 2015 14:24
-
-
Save floatdrop/d316850e08c4eaaf29a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var koa = require('koa'); | |
var app = koa(); | |
var backend = require('./backend'); | |
var router = require('koa-router')(); | |
router.get('/todo/', function *(next) { | |
var sid = yield backend.sessid(); | |
this.body = yield { | |
sessid: sid, | |
status: backend.status(sid), | |
todo: backend.todos(sid), | |
}; | |
}); | |
router.get('/', function *(next) { | |
this.body = yield { | |
ads: backend.ads(), | |
users: backend.users(), | |
sessionid: backend.sessid() | |
}; | |
}); | |
app.use(router.routes()) | |
app.listen(1337); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment