项目
在 GitHub 查看
scottcorgan/pushstate-server
关于
支持 HTML5 Pushstate 的静态文件服务器
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文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])
- start the pushstate static file server
options
port- set the port that the server should open
- uses
process.env.PORTif not specified, and defaults to port9000if 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
探索相关项目
加载中…