0.0.1 • Published 10 years ago
servelo v0.0.1
serve
test server for javascript apps mainly for angular / yo / ngbp
Synopsis
This is a small tool to run very basic static file server to test webapps.
Installation
npm install serve --save-devhen edit package.json script. e.g.
scripts: {
serve: "node ./node_modules/serve/bin/start --home yourWwwDir --port 3000
}
npm run servealternativly you can run init script in /bin/init which will create scripts and public direcotries, and creates start script
in your main project folder and adds this line into the package.json scripts
serve: "node ./scripts/start --home public"serve will use default port 3001, you can change any of that.
Use
npm
add run srcript into scripts
scripts: {
start: "node ./bin/start --home yourWwwDirectory --port 3000"
//or
serve: "node ./bin/start --home yourWwwDirectory --port 3000"
}the above will setup static http server running on port 3000 (default is 3001) and serving files from ./yourWwwDirectory
relative to your npm package.json file
npm startor
npm run serve0.0.1
10 years ago