pushstate-server
Static file server that works with HTML5 Pushstate.
Last updated 12 years ago by scottcorgan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pushstate-server 
SYNC missed versions from official npm registry.

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 [directory] [port] [file]

API

start(options[, callback])

  • start the pushstate static file server
options
  • port
    • set the port that the server should open
    • uses process.env.PORT if not specified, and defaults to port 9000 if none is available
  • directory
    • the path to the directory where the static assets will be served
    • defaults to public
  • file
    • Custom file to serve
    • defaults to index.html

Current Tags

  • 3.1.0                                ...           latest (7 years ago)

29 Versions

  • 3.1.0                                ...           7 years ago
  • 3.0.1                                ...           9 years ago
  • 3.0.0                                ...           9 years ago
  • 2.2.2                                ...           9 years ago
  • 2.2.1                                ...           9 years ago
  • 2.2.0                                ...           9 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.14.0                                ...           10 years ago
  • 1.13.0                                ...           10 years ago
  • 1.12.0                                ...           10 years ago
  • 1.11.0                                ...           10 years ago
  • 1.10.0                                ...           10 years ago
  • 1.9.0                                ...           10 years ago
  • 1.8.1                                ...           10 years ago
  • 1.8.0                                ...           10 years ago
  • 1.7.0                                ...           10 years ago
  • 1.6.0                                ...           11 years ago
  • 1.5.0                                ...           11 years ago
  • 1.4.0                                ...           11 years ago
  • 1.3.0                                ...           11 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.3                                ...           13 years ago
  • 0.1.2                                ...           13 years ago
  • 0.1.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 6
Last Month 6
Dependencies (2)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |