Created
July 9, 2017 10:21
-
-
Save zhanglongqi/8ca3aadb357d1cdb0b625dc7e85f53f1 to your computer and use it in GitHub Desktop.
change the root path of Python http.server
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
| from os import chdir | |
| from os.path import join, dirname | |
| from http.server import SimpleHTTPRequestHandler, test | |
| chdir(join(dirname(__file__), 'YOUR_WEB_ROOT_PATH')) | |
| test(SimpleHTTPRequestHandler, port=8080, bind='0.0.0.0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment