@kard/spa-server v0.1.0-rc.1
A simple NodeJS based server allows serving SPA applications with optional API proxy support and all-routes fallback. It developed to test SPA locally, with Puppeteer or Selenium-based frameworks.
Installation
npm add -D @kard/spa-serverUsage
spa-server --proxy=api::http://jsonplaceholder.typicode.com --port=3030 --public=public --fallback=index.htmlThe example above :
- Will serve static files from
./publicrelative path, on port 3030. - Each file is absent will be replaced with
./public/index.htmlone. - All of the requests sent to
/api/*routes will be redirected tohttp://jsonplaceholder.typicode.combase.
Command-line keys available
--proxy - allows setting API requests redirect (no default)
--port - allows setting the server port to use (default 3000)
--public - allows setting public path (default ./)
--fallback - allows setting fallback file name (default is index.html)
--route - allows setting base route of the app (default is none)
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago