Skip to content

Instantly share code, notes, and snippets.

View manuelmdn's full-sized avatar
👁️
Focusing

Manuel Medina manuelmdn

👁️
Focusing
View GitHub Profile
@manuelmdn
manuelmdn / web-servers.md
Created May 5, 2018 04:04 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
var http = require('http'),
util = require('util'),
formidable = require('formidable'),
server;
server = http.createServer(function(req, res) {
if (req.url == '/') {
res.writeHead(200, {'content-type': 'text/html'});
res.end(
"<div align='center'>"+