Skip to content

jiawei397/oak_compress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oak_compress

Deno

A simple and opinionated deflatebrotli and gzip compress middleware for Deno oak.

Example

import {
  brotli,
  deflate,
  gzip,
} from "https://deno.land/x/oak_compress@v0.0.2/mod.ts";
import { Application } from "https://deno.land/x/oak@v10.5.0/mod.ts";

const app = new Application();
app.use(brotli());
// app.use(gzip());
// app.use(deflate());

// other middleware

app.use((ctx) => {
  const str = new Array(100000).fill("Hello World").join("\n");
  ctx.response.body = str;
});

console.log("app started with: http://localhost");
await app.listen(":80");

About

oak middleware, support br, gzip and deflate

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published