mirror of
https://github.com/koajs/examples.git
synced 2026-01-18 14:38:19 +00:00
13 lines
225 B
JavaScript
13 lines
225 B
JavaScript
const Koa = require('koa');
|
|
|
|
const View = require('./view');
|
|
|
|
const app = module.exports = new Koa();
|
|
|
|
app.use(async function(ctx) {
|
|
ctx.type = 'html';
|
|
ctx.body = new View(ctx);
|
|
});
|
|
|
|
if (!module.parent) app.listen(3000);
|