Skip to content

Instantly share code, notes, and snippets.

@amacneil
Last active April 27, 2016 07:45
Show Gist options
  • Save amacneil/15f844ed1498341db4a9031ded3b1340 to your computer and use it in GitHub Desktop.
Save amacneil/15f844ed1498341db4a9031ded3b1340 to your computer and use it in GitHub Desktop.
import Koa from 'koa';
import Router from 'koa-router';
const koa = new Koa();
const app = new Router();
app.get('/:name', async (ctx) => {
ctx.body = `Hello, ${ctx.params.name}!\n`;
});
koa.use(app.routes());
koa.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment