How to run html file on localhost?

后端 未结 8 679
再見小時候
再見小時候 2020-12-04 08:41

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 exampl

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 09:17

    As Nora suggests, you can use the python simple server. Navigate to the folder from which you want to serve your html page, then execute python -m SimpleHTTPServer. Now you can use your web-browser and navigate to http://localhost:8000/ where your page is being served. If your page is named index.html then the server automatically loads that for you. If you want to access any other page, you'll need to browse to http://localhost:8000/{your page name}

提交回复
热议问题