Skip to content

Instantly share code, notes, and snippets.

@semlinker
Last active August 1, 2022 02:13
Show Gist options
  • Save semlinker/10f603735909258d4320c3c47d469112 to your computer and use it in GitHub Desktop.
Save semlinker/10f603735909258d4320c3c47d469112 to your computer and use it in GitHub Desktop.
HTTP Transfer Large Files
const Koa = require("koa");
const cors = require("@koa/cors");
const serve = require("koa-static");
const range = require("koa-range");
const app = new Koa();
// register middlewares
app.use(cors());
app.use(range);
app.use(serve("."));
app.listen(3000, () => {
console.log("app starting at port 3000");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment