19 January 2012
Quick staging of HTML builds
Here’s a simple process to “publish” a local HTML build on a Mac. This can be useful for quick demos of work to other team members. Or (this is how I used it yesterday), viewing work in virtual machines for Internet Explorer testing.
1. Add this somewhere in your shell profile. For me, this is at ~/.profile. Garrett supplied this tip to us.
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
2. Open up a new terminal window and change directory to the folder containing the work you want to stage. Run the following to create a simple web server.
server
3. Now, you can go to http://localhost:8000 in a web browser to view the directory you launched the server from.
4. Install the localtunnel gem following the instructions on their site. It’s pretty simple.
5. Stage your build using localtunnel by running (assuming you have a public key generated in the standard location) the following.
localtunnel -k ~/.ssh/id_rsa.pub 8000
6. Now you’ll be able to view your work at http://****.localtunnel.com. Badical.