mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
21 lines
386 B
TypeScript
21 lines
386 B
TypeScript
import Koa = require("koa");
|
|
import views = require("koa-views");
|
|
|
|
const app = new Koa();
|
|
|
|
app.use(views('/views', {
|
|
autoRender: true,
|
|
map: {
|
|
html: 'underscore'
|
|
},
|
|
extension: '.html',
|
|
engineSource: {},
|
|
options: {}
|
|
}));
|
|
|
|
app.use((ctx: Koa.Context) => {
|
|
ctx.render('user', {
|
|
user: 'John'
|
|
}).then(() => console.log('done render call'));
|
|
});
|