1.0.1 • Published 7 years ago

koa2-static v1.0.1

Weekly downloads
33
License
MIT
Repository
-
Last release
7 years ago

koa2-static

Koa2 middleware for serving static files.

Install

npm install koa2-static

Usage

import Koa from "koa"
import static from "koa2-static"

const app = new Koa()

app.use(static({
  path: "/web",
  root: __dirname + "/assets" 
}));
app.listen(8000)

Options

  • root {string} directory that is to be served
  • path {string} url base path

Others see koa-send