Files
DefinitelyTyped/koa-send/koa-send-tests.ts
2016-10-08 10:45:01 -07:00

24 lines
531 B
TypeScript

/// <reference path="../koa/koa.d.ts" />
/// <reference path="koa-send.d.ts" />
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: () => {},
});
});