Skip to content

Instantly share code, notes, and snippets.

@floatdrop floatdrop/app.js
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.