Skip to content

Instantly share code, notes, and snippets.

@calesce
calesce / server.py
Created October 23, 2017 23:04 — forked from martijnvermaat/server.py
SimpleHTTPServer with history API fallback, works with python and python3
#!/usr/bin/env python
"""
Modification of `python -m SimpleHTTPServer` with a fallback to /index.html
on requests for non-existing files.
This is useful when serving a static single page application using the HTML5
history API.
"""