1.3.0 • Published 4 years ago
@marius321967/spaserve v1.3.0
Single Page App (SPA) file server based on Express.js Static middleware.
If the file is not found then requests will serve index.html with 200 status code. If user requests a special route (default: /404) then index.html will be served with a 404 status code.
Supports HTTP2 when running in HTTPS mode (using spdy).
The tool runs a single port and does not provide HTTP to HTTPS redirects. For this, find a separate tool (Docker: morbz/docker-web-redirect).
Arguments
--port--dirthe directory to serve static files from. Default:dist--notfoundroutepath (without leading/) which will return 404 statuses. SPAs can close & redirect to this route for a proper 404 response. Default route:404--httpsenables HTTPS instead of HTTP. Default:false. For self-signed certificates, see Node.JS tutorial--sslkeyfilename of SSL private key. Default:ssl/key.pem--sslcertfilename of SSL certificate. Default:ssl/cert.pem--sslpassphrasepassphrase for SSL private key--maxageseconds in Cache-Control header. Default:600
Arguments can also be passed via uppercase environment variables.