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. Show asked Jul 21, 2016 at 7:10
Volkan ŞahinVolkan Şahin 1,0211 gold badge10 silver badges15 bronze badges 1 You can run your file in http-server. 1> Have Node.js installed in your system. 2> In CMD, run the command npm install http-server -g 3> Navigate to the specific path of your file folder in CMD and run the command http-server 4> Go to your browser and type localhost:8080. Your Application should run there. Thanks:)
emlai 40.7k9 gold badges100 silver badges151 bronze badges answered Jan 21, 2018 at 6:53
5
You can use If you are using python 2 (instead of 3), the equivalent command is
DBolton 4664 silver badges8 bronze badges answered Jul 21, 2016 at 7:13
NoraNora 2,9731 gold badge21 silver badges22 bronze badges 4 If you are running Python3, you may want to instead try:
See this answer. answered Aug 13, 2018 at 1:16
MrEMrE 2702 silver badges5 bronze badges
answered Feb 14, 2019 at 12:48
Ritu GuptaRitu Gupta 2,0311 gold badge16 silver badges9 bronze badges If you have Node.js installed then from the folder you want to share you can simply run:
To add CORS you can run:
answered Nov 20, 2021 at 7:50
saxsax 6991 gold badge11 silver badges23 bronze badges 1 On macOS:Open Terminal (or iTerm) install Homebrew then run You also can install Python 3 and run On Windows:If you have VS Code installed open it and install extension liveserver, then click Go Live in the bottom right corner. Alternatively you can install WSL2 and follow the macOS steps via
apt ( On Linux:Open your favorite terminal emulator and follow the macOS steps via apt ( answered Sep 2, 2020 at 15:21
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 answered Jul 21, 2016 at 8:18
You can try installing one of the following localhost softwares:
There are many more such softwares but the best among them are the ones mentioned above. they also allow domain names (for example: answered Apr 4, 2020 at 6:50 You can install Xampp and run apache serve and place your file to www folder and access your file at localhost/{file name} or simply at localhost if your file is named index.html answered Aug 21, 2019 at 10:40
HamzaMushtaqHamzaMushtaq 1,59413 silver badges13 bronze badges You can also use PHP to server the files in http make sure you installed PHP, run the below command to verify
if PHP is not installed run below command to install it
Once after the installation go to the file path and execute the below command in the terminal
answered Jan 25 at 0:32
|