Skip to content
/ serve Public

test server for javascript apps mainly for angular / yo / ngbp

License

Notifications You must be signed in to change notification settings

webduvet/serve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-dev

then edit package.json script. e.g.

scripts: {
	serve: "node ./node_modules/serve/bin/start --home yourWwwDir --port 3000
}

npm run serve

alternativly 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 start

or

npm run serve

or just start executable

./bin/serve --port XXXX --home yourDir

TODO

wrapping script

make the script which would would allow to run any angular app on this simple server without using gulp or grunt solutions or without running apache localhost to server static files.

integration script

integration into grunt and gulp would be good

write some tests

documentation - youDoc ?

integrate logger - winston? or allow for logger injection ...

revise the global space

About

test server for javascript apps mainly for angular / yo / ngbp

Resources

License

Stars

Watchers

Forks

Packages

No packages published