Quickly Hosting Static Files In Your Development Environment with Node http-server

Yesterday, I was looking for something to have a really quick test space on my machine to play with AngularJS and I found http-server: a simple zero-configuration command-line http server.
2014-09-28 13:19
Tugberk Ugurlu

Yesterday, I was looking into AngularJS which is a long overdue for me. I wanted to have a really quick test space on my machine to play with AngularJS. I could just go with Plunker or JSFiddle but I wasn’t in the mood for an online editor.

So, I first installed Bower and then I installed a few libraries to get me going. I made sure to save them inside my bower.json file, too:


bower install angular -S
bower install bootstrap -S
bower install underscore –S


Then, I installed my node module to help me automate a few processes with gulp.

BTW, do you know VS has support for running you gulp and grunt tasks? Check out Scott Hanselman’s post if you don’t: Introducing Gulp, Grunt, Bower, and npm support for Visual Studio

Finally, I have written a few lines of code to get me going. The state the this tiny app can be found under my GtHub account. I was at the point where I would like to see it working in my browser:


As a developer who have been heavily working with .NET for a while, I wanted to hit F5 :) Jokes aside, what I only want here is something so simple that would host my static files inside my directory with no configuration required. While searching a great option for this, I found http-server: a simple zero-configuration command-line http server.


I simply installed it as an global npm module:


All done! It’s now under my path and I can simply cd into my root web site directory and run http-server there.


Super simple! It also observes the changes. So, you can modify your files as the http-server serves them. You can even combine this with LiveReload + a gulp task.


Bold CallGirls in Chandigarh
by Bold CallGirls in Chandigarh on Saturday, Sep 03 2016 08:04:48 +00:00
Thanks for sharing. I hope it will be helpful for too many people that are searching for this topic.
Hot Escorts in Dehradun
by Hot Escorts in Dehradun on Saturday, Sep 03 2016 19:31:39 +00:00
Thanks for share with us this great topic, I just want to read your more topic.
Gurgaon Escorts Service Babes
by Gurgaon Escorts Service Babes on Tuesday, Oct 04 2016 18:58:30 +00:00
Godadday Hosting Service is Best
by zapya on Tuesday, Oct 25 2016 11:39:29 +00:00
Download Zapya for PC to share files and folders easily from PC to other devices