Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Lloyd Brookes edited this pageFeb 16, 2022 ·100 revisions

Feel free to edit this wiki. If something is missing or not clear, please raise a ticket.

The Basics

Local-web-server is a distribution oflws bundled with a "starter pack" of useful middleware.

Default stack tutorials

This table shows each middleware in the default stack, in order, with a link to a usage tutorial.

NameDescription
Basic AuthHow to password-protect a server using Basic Authentication.
Body ParserHow to access the body of an incoming request
Request MonitorFeeds traffic information to the--verbose output.
LogHow to output an access log
How to visualise access logs with third-party tools
CorsHow to configure Cross-Origin Resource Sharing (CORS)
JsonPretty-prints JSON responses.
RewriteHow to rewrite URLs to local or remote destinations
BlacklistHow to blacklist certain routes
Conditional GetHow to use HTTP Conditional Requests
MimeHow to customise mime types
CompressCompress responses using gzip.
SPAHow to serve a Single Page Application (SPA)
StaticHow to serve static files
IndexServes directory listings.

Other middleware plugins

These are not part of the default middleware stack but can be added to a custom stack.

NameDescription
RedirectPerform a 302 Redirect if the requested URL matches a specified regular expression.
How to redirect HTTP traffic to HTTPS (satisfies Lighthouse audit)
Error DetailIncludes the error stack trace in the response.

Extending

Plugins

If you publish a middleware module, don't forget to add thelws-middleware keyword.

API Reference

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp