Static file server that works with HTML5 Pushstate.
Static file server that works with HTML5 Pushstate.
For example, the route
/some/pushstate/routewill return the
index.htmlfile. But,
/some/static/path/logo.pngwill return the
logo.pngstatic file.
npm install pushstate-server --save
var server = require('pushstate-server');server.start({ port: 3000, directory: './public' });
or for multiple directories
var server = require('pushstate-server');server.start({ port: 4200, directories: ['./public', './bower_components'] });
or bind to a particular host
server.start({ port: 4200, host: '192.99.100.01', directories: ['./public', './bower_components'] });
npm install -g pushstate-server
usage: pushstate-server [-d directory] [-p port] [-f file]
port
process.env.PORTif not specified, and defaults to port
9000if none is available
directory
public
file
index.html