Skip to content

Instantly share code, notes, and snippets.

@jdkanani
jdkanani / Server.py
Last active April 25, 2023 16:40
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):