node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

jspm-dev-server

JSPM Dev Server

HTTP/2 enabled server with support for systemjs-hot-reloader.

Usage

npm install jspm-dev-server --save-dev
openssl req -x509 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -days 30 -nodes -subj '/CN=localhost'
echo 'localhost.*' >> .gitignore
jspm-dev-server

Then just open https://localhost:3000 and you'll see your app running.

Options

 
  Usage: jspm-dev-server [options]
 
  Options:
 
    -h, --help           output usage information
    -V, --version        output the version number
    -p, --port <n>       port to listen on. defaults to 3000
    -d, --dir <folder>   directory to serve static files from
    -c, --cert <pem>     path to a PEM certificate. defaults to localhost.crt in current folder
    -k, --key <pem>      path to a PEM key. defaults to localhost.key in current folder
    -i, --ignore <path>  paths to ignore from file watching
    -l, --proxy <url>    url to forward the request if file is not found
 

Examples

If you have a Rails app and want to serve some assets over HTTP/2, you can use the proxy:

jspm-dev-server --port 3001 --proxy http://localhost:3000

If you need to serve different folder, than you are currently in, use the directory setting:

jspm-dev-server --dir static/

TODO

  • configure which folder to serve
  • ability to control the middleware
  • configurable paths to certs
  • configurable port
  • proxy to fallback server

Projects

This project is using: