Skip to content

Commit

Permalink
Create start_offline_webserver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cuppajoeman authored Nov 7, 2023
1 parent 96aaa5a commit ce641c4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions start_offline_webserver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import http.server
import socketserver
import os

os.chdir('htdocs');

class Handler(http.server.SimpleHTTPRequestHandler):
extensions_map = http.server.SimpleHTTPRequestHandler.extensions_map.copy()
extensions_map[''] = 'text/html'


host = "localhost"
port = 8000
with socketserver.TCPServer((host, port), Handler) as httpd:
print(f"serving docs at http://{host}:{port}")
httpd.serve_forever()

0 comments on commit ce641c4

Please sign in to comment.