如何在本地主机上运行HTML文件? [英] How to run html file on localhost?
问题描述
我有一个html文件,并且我在localhost上运行它.但是,此文件包括使用网络摄像头的镜像.例如,如何在本地主机上运行此html文件?网络摄像头开始在这个例子中,当检查现场复选框.感谢您的答复.
I have a html file and i run it on localhost. But, this file includes mirror using webcam. Example, how can i run this html file on localhost? Webcam starting on this example when check to live checkbox. Thanx for your reply.
推荐答案
您可以使用python -m http.server
.默认情况下,本地服务器将在端口8000上运行.如果要更改此端口,只需添加端口号python -m http.server 1234
You can use python -m http.server
. By default the local server will run on port 8000. If you would like to change this, simply add the port number python -m http.server 1234
如果您使用的是python 2(而不是3),则等效命令为python -m SimpleHTTPServer
If you are using python 2 (instead of 3), the equivalent command is python -m SimpleHTTPServer
这篇关于如何在本地主机上运行HTML文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!