javascripthtmllocalhostwebcammirror

How to run html file on localhost?


I have an HTML file and I run it on localhost. But, this file includes a mirror using a webcam. For example, how can I run this HTML file on localhost? Webcam starts in this example when checking to live checkbox.


Solution

  • 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

    If you are using python 2 (instead of 3), the equivalent command is python -m SimpleHTTPServer