Http server
Posted badweather
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Http server相关的知识,希望对你有一定的参考价值。
Using Python to quickly build a local directory as a Http server
- Quick way to open CMD command in any folder in Windows system:
Method 1:
Press shift in the margin of the folder and right-click the mouse button.
Select ‘Open Command Window Here‘.
Win10: Select ‘powershell‘,can also enter "start cmd"
Method 2:
Enter CMD to return in the path box on this folder
- Steps:
1.Install python, add installation directory to system environment variable PATH
2.Get the local IP address through the‘ipconfig‘command
3.Open CMD command in the HttpServer folder
4.Run the following command
python -m http.server 8010
# python 3.0
python -m SimpleHTTPServer 8010
# python 2.0
--> Serving HTTP on 0.0.0.0 port 8010 ...
5.Usage:
local:
http://localhost:8010/
webs:
http://192.168.8.112:8010/
# ‘192.168.8.112‘ is your IP,
# ‘8010‘:Customizable port number
以上是关于Http server的主要内容,如果未能解决你的问题,请参考以下文章