in Tips

Simple Http Server on Mac

While working on html/css/js, it’s convenient to view those pages from http server. However, I don’t want to use MAMP or Virtual machine to set up nginx/apache.

I found this pro tip from this.

So I ended up with adding an alias to my .bash_profile file as follows:

Note that port number below 1024 cannot be bound as a normal user. This is meant to simply run a http server for development purpose. Do not use it to run your web application.