Files
DefinitelyTyped/koa-send/koa-send-tests.ts
Peter Safranek dc33fb1259 [types-2.0] Add type definitions for koa-send. (#11946)
* Add type definitions for koa-send.

* Use correct file name and add tsconfig.
2016-10-25 22:11:17 +09:00

22 lines
451 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: () => {},
});
});