mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
16 lines
307 B
TypeScript
16 lines
307 B
TypeScript
/// <reference path="../koa/koa.d.ts" />
|
|
/// <reference path="koa-compress.d.ts" />
|
|
|
|
import * as Koa from "koa";
|
|
import compress = require("koa-compress");
|
|
|
|
const app = new Koa();
|
|
|
|
app.use(compress({
|
|
filter: (ctype) => {
|
|
return /text/i.test(ctype)
|
|
},
|
|
threshold: 2048
|
|
}));
|
|
|
|
app.listen(80) |