lws-static

v3.1.1
Lws middleware wrapper for koa-static
lws lws-middleware static server

view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI js-standard-style

lws-static

Lws middleware plugin to serve static files, wraps koa-static. See here for usage instrutions.

Adds the following options to lws.


--directory, -d path           Root directory, defaults to the current directory.
--static.maxage number         Cache max-age (in seconds) applied to all resources served.
--static.defer                 If true, serves after `await next`, allowing any downstream middleware to
                               respond first.
--static.index path            Default file name, defaults to `index.html`.
--static.extensions ext        One or more default filename extensions. For example, if you set
                               `--static.extensions html` and request `/page` then the server will look for
                               both `page` and `page.html` on disk, serving the latter.

© 2016-24 Lloyd Brookes <[email protected]>.

npm i lws-static

Metadata

  • MIT
  • >=12.17
  • Lloyd Brookes
  • released 8/1/2024

Downloads

Maintainers