I have searched stackoverflow and some forums and couldn't find a direct solution and later I came across some ans which works fine so I'm posting it here :)
The ans is for the below folder structure and you can also customize it for your folder structure.
--project
---app
----js
----services
----(...)
----index.html
Please refer the answer below. Please post if you have better way to do it and also you can add some comments to make the answer better. Thanks.
Method 1:
Using node.js to run index.html file copy paste the below code to server.js file in your app folder(above hierarchy)
and from the app folder run
node server.js
. Your html file will be serving in localhost:3000Method 2:
Using http-server. Follow the steps in this link to install http-server globally and from your app folder run cmd
http-server -a localhost -p 8000 -c-1 ./app
and your index.html file will be serving in localhost:8000
Note: You can change the port number in .listen and -p in above methods.