scottcorgan / pushstate-server

Static file server that works with HTML5 Pushstate.
421 stars 35 forks source link
html5-pushstate node pushstate-server server

pushstate-server

Static file server that works with HTML5 Pushstate.

For example, the route /some/pushstate/route will return the index.html file. But, /some/static/path/logo.png will return the logo.png static file.

Install

npm install pushstate-server --save

Usage

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']
});

Global Install

npm install -g pushstate-server
usage: pushstate-server [-d directory] [-p port] [-f file]

API

start(options[, callback])

options