Live data from Hacker News

Web server in one line of bash

razvantudorica.com

11–20 of 69 posts

Re: Web server in one line of bash

#11
We've used a similar trick to copy files between coworkers:

  on server: while true; nc -l $PORT  $FILE
Quick, simple and easy to fire up. You can continue to hack on the file and nc will serve up the latest saved version.

Re: Web server in one line of bash

#14

$ busybox httpd Works even in an initramfs, and in some embedded systems. Serves up the current directory, and you can even have CGI scripts in cgi-bin.

Thanks! I'd forgotten about busybox, but that's often how your home router is doing things.

* Side note: if it is, make sure your router manufacturer provides the GPL source release.

Re: Web server in one line of bash

#20

$ busybox httpd Works even in an initramfs, and in some embedded systems. Serves up the current directory, and you can even have CGI scripts in cgi-bin.

Woah, I didn't realize busybox had an httpd. Truly a sweet piece of software.

It often won't, as features ("applets") are chosen at compile-time.
Post reply on HN