koa2-static

1.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i koa2-static

Weekly Downloads

37

Version

1.0.1

License

MIT

Last publish

Collaborators

  • jparser