mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
23 lines
482 B
TypeScript
23 lines
482 B
TypeScript
|
|
import * as Koa from 'koa';
|
|
import * as send from 'koa-send';
|
|
|
|
const app = new Koa();
|
|
|
|
app.use(async (ctx: Koa.Context) => {
|
|
const path: string = await send(ctx, 'stimpy.html');
|
|
});
|
|
|
|
app.use(async (ctx: Koa.Context) => {
|
|
await send(ctx, 'stimpy.html', {
|
|
root: '../static-files',
|
|
index: 'index.html',
|
|
maxAge: 10,
|
|
hidden: true,
|
|
format: true,
|
|
gzip: true,
|
|
setHeaders: () => {},
|
|
extensions: ['shemp'],
|
|
});
|
|
});
|