https://github.com/lwsjs/static
Middleware for lws to serve static files.
https://github.com/lwsjs/static
backend lws lws-middleware webserver
Last synced: 3 months ago
JSON representation
Middleware for lws to serve static files.
- Host: GitHub
- URL: https://github.com/lwsjs/static
- Owner: lwsjs
- License: mit
- Created: 2016-06-26T22:03:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-01T08:41:54.000Z (11 months ago)
- Last Synced: 2025-03-27T02:11:53.359Z (3 months ago)
- Topics: backend, lws, lws-middleware, webserver
- Language: JavaScript
- Homepage:
- Size: 133 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.org/package/lws-static)
[](https://www.npmjs.org/package/lws-static)
[](https://github.com/lwsjs/static/network/dependents?dependent_type=REPOSITORY)
[](https://github.com/lwsjs/static/network/dependents?dependent_type=PACKAGE)
[](https://github.com/lwsjs/static/actions/workflows/node.js.yml)
[](https://github.com/feross/standard)# lws-static
Lws middleware plugin to serve static files, wraps [koa-static](https://github.com/koajs/static). See [here](https://github.com/lwsjs/local-web-server/wiki/How-to-serve-static-files) 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]\>.