mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
23 lines
319 B
TypeScript
23 lines
319 B
TypeScript
import Koa = require("koa");
|
|
import compress = require("kompression");
|
|
|
|
const app = new Koa();
|
|
|
|
app.use(
|
|
compress()
|
|
);
|
|
|
|
app.use(
|
|
compress({})
|
|
);
|
|
|
|
// based on README
|
|
app.use(
|
|
compress({
|
|
filter(contentType) {
|
|
return /text/i.test(contentType);
|
|
},
|
|
threshold: 2048,
|
|
})
|
|
);
|