za91hg
Last Updated: February 25, 2016
·
1.235K
· ipetepete
522f44265e0ed80578f6d3af4cdf7011

Get yer serve on! Quick 'n Simple Server

Got some html, css, js that you want to test out on your local machine (without the hassle of VirtualHosts, Apache, Nginx, etc, etc...)?

Would you like to not use relative urls?

Want to run a demo of a prototype design?

Well I have a great tip for you. Run a simple server with Python! For free! Yes friends here it is (from the command line do this):

python -m SimpleHTTPServer 4000

This will run a server at port 4000 with the root being the current directory you are in.

So in your browser you can get to it via: http://localhost:4000

Happy Coding!

Say Thanks
Respond

1 Response
Add your response

7936
0439e12eafba101cc706507a6bce46ca

I prefer using the NodeJS-based "http-server": https://github.com/nodeapps/http-server

It's lightning fast and I've found that the Python simple server can get backed up when serving a lot of files at once, usually requiring multiple page reloads to get around it.

Just do "npm install -g http-server" to install it globally. I've got mine aliased to "serveme" because that's faster to type. ( =

over 1 year ago ·