Skip to content

Instantly share code, notes, and snippets.

@jdkanani
jdkanani / Server.py
Last active September 21, 2024 14:44
Python SimpleHTTPServer : Routing sample
#!/usr/bin/env python
import os
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
ROUTES = [
('/', '/var/www/doc-html')
]
class MyHandler(SimpleHTTPRequestHandler):