mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
20 lines
362 B
TypeScript
20 lines
362 B
TypeScript
import * as Koa from "koa";
|
|
import * as views from "koa-views";
|
|
|
|
const app = new Koa();
|
|
|
|
app.use(views('/views', {
|
|
map: {
|
|
html: 'underscore'
|
|
},
|
|
extension: '.html',
|
|
engineSource: {},
|
|
options: {}
|
|
}));
|
|
|
|
app.use((ctx: Koa.Context) => {
|
|
ctx.render('user', {
|
|
user: 'John'
|
|
}).then(() => console.log('done render call'));
|
|
});
|