Quickly serve up static assets with node
Previously when I wanted to quickly serve up some HTML/JavaScript I'd use a boilerplate Express app but it's actually even easier to use the http-server package.
Globally install the awesome http-server package
npm install -g http-server
Then run this from the folder with your assets
http-server -c-1
"-c Set cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds (defaults to '3600'). To disable caching, use -c-1."
For more info see:
Written by James Gardner
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#