One Line Webserver

Check out this swift little tip from razvantudorica.com:

This little line of BASH lets you save files via http and then access them as: http://host_ip:8080/. (No, it’s not really a web server, it’s netcat.)

while true; do { echo -e ‘HTTP/1.1 200 OK\r\n’; cat index.html; } | nc -l 8080; done

Wondering what BASH is? It’s “Born Again Shell Script” and is what you write in the Terminal on Mac or Linux and Powershell on Windows. If you’ve got two days, you can learn to navigate pretty darn well by following: this Command Line tutorial.

 

About

A typographic, designological, visulicious extravaganza!

Posted in Technical Geekery, Tutorial, Useful Code, Web