Skip to content

JSPM Development Server (HTTP/2 + Hot Module Replacement)

Notifications You must be signed in to change notification settings

mikz/jspm-dev-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Note for Windows git bash users

The openssl command above has to be modified to work on git bash on Windows. Please use this command instead:

openssl req -x509 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -days 30 -nodes -subj '//CN=localhost'

Notice the double slash in the -subj parameter. For more info see this stack overflow answer.

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 https://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:

About

JSPM Development Server (HTTP/2 + Hot Module Replacement)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published