Web server in one line of bash
21–30 of 69 posts
Re: Web server in one line of bash
#22ruby -run -e httpd . -p 5000
Re: Web server in one line of bash
#23Re: Web server in one line of bash
#24This seems to be straight from Wikipedia and then wrapped in a while loop: https://en.wikipedia.org/wiki/Netcat#Setting_up_a_one-shot_w... netcat's cool, but the post could've gone a bit further. If it's an intro "how to do this", maybe explain the moving parts for beginners?
Re: Web server in one line of bash
#25 npm install -g node-static
# serve up the current directory
$ static
serving "." at http://127.0.0.1:8080
More at https://github.com/cloudhead/node-staticRe: Web server in one line of bash
#26If you have python, then these are really useful, just serves up the current directory. Python 2.x: python -m SimpleHTTPServer Python 3.x: python -m http.server 8000
twistd --nodaemon web --path=. -c snakeoil.crt -k snakeoil.key --https=8443
And to generate a 100-year localhost key/cert for use with this: openssl genrsa -passout pass:dummy -out snakeoil.secure.key 1024
openssl rsa -passin pass:dummy -in snakeoil.secure.key -out snakeoil.key
openssl req -new -subj "/commonName=localhost" -key snakeoil.key -out snakeoil.csr
openssl x509 -req -days 36500 -in snakeoil.csr -signkey snakeoil.key -out snakeoil.crtRe: Web server in one line of bash
#27 $ goe 'net/http' 'ListenAndServe(":8080", FileServer(Dir("/usr/share/doc/")))'
[1] https://github.com/shurcooL/goeRe: Web server in one line of bash
#28If you have node-static installed. npm install -g node-static # serve up the current directory $ static serving "." at http://127.0.0.1:8080 More at https://github.com/cloudhead/node-static
Re: Web server in one line of bash
#29If you have node-static installed. npm install -g node-static # serve up the current directory $ static serving "." at http://127.0.0.1:8080 More at https://github.com/cloudhead/node-static
php -S 127.0.0.1:8080Re: Web server in one line of bash
#30If you have node-static installed. npm install -g node-static # serve up the current directory $ static serving "." at http://127.0.0.1:8080 More at https://github.com/cloudhead/node-static
Similarly, if PHP 5.4 (or greater) is installed: php -S 127.0.0.1:8080
http://stackoverflow.com/questions/3940046/can-i-use-netcat-... seems to have a basic example.