Created
September 23, 2020 14:59
-
-
Save JohnL4/7fbfb5de9bd330dd6d5cb84a2014074f to your computer and use it in GitHub Desktop.
Use Python to simply server files from local dir, giving javascript the correct MIME type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use to create local host, server javascript modules w/the correct mimetime. | |
# See https://stackoverflow.com/a/60638762 | |
# | |
import http.server | |
import socketserver | |
PORT = 8080 | |
Handler = http.server.SimpleHTTPRequestHandler | |
Handler.extensions_map.update({ | |
".js": "application/javascript", | |
}) | |
httpd = socketserver.TCPServer(("", PORT), Handler) | |
httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment