Serve - a practical command line webserver

30th January 2014 | by Adam Beres-Deak | tool, webserver, command line

A few weeks ago I found a very amazing tool - it's called "serve".

What can it do for you?

Just simply serve you files over http:// protocol. Besides static files it supports jade templates, stylus and less. I usually use it, when I need an ad-hoc web server, like when downloading some sources from github and I want to check out the examples. They sometimes need a 'real web server', because of the limitations of the file:// protocol.

How to use it?

Install it the usual way with npm install -g serve and you should be fine. Then just simply cd into the directory which you want to be able to access from http://localhost and run serve. Default port is 3000 but, as many things, it's configurable. That's it.

For more documentation visit the github/serve project page.

by Adam Beres-Deak

| Share | Tweet | Share | Share

Latest blog posts

Displaying icons with custom elements 14th October 2015

Plain JavaScript event delegation 26th January 2015

After the first year of blogging - what happened on my blog in 2014? 1st January 2015

Better webfont loading with using localStorage and providing WOFF2 support 18th December 2014

Worth watching: Douglas Crockford speaking about the new good parts of JavaScript in 2014 20th October 2014