Search results

Uparrow
1
Downarrow
Daniel Ge

#!/bin/bash

# Start an HTTP server from a directory, optionally specifying the port

function server() {
local port="${1:-8000}"
( sleep 2; open "http://localhost:${port}/" ) &
python -m SimpleHTTPServer "$port"
}

Create a simple Python server in the current directory with the simple comman...
created about 6 years ago

Tags: python server shell