Ninjadoodle Posted March 5, 2015 Share Posted March 5, 2015 Hi guys So, I've finally got the Panda installation running with npm and http-server I know that I can use ... http-server -o ... to open a browser window with the web server running, but I can't figure out how to run a specific html file, as the server defaults to running index.html by default. I understand that I can add ... http://0.0.0.0:8080/dev.html ... on the end of the address in order to run another file, but I'm wondering whether there is a way to run dev.html from the command line, when starting the server? Thank you in advance! Quote Link to comment Share on other sites More sharing options...
Neso Posted March 5, 2015 Share Posted March 5, 2015 Evading the explanation how web servers work. There are two things you could do. Since you are already using nodejs use it to point default endpoint to dev file instead index. If you don't know how to do it. Then maybe the best option would be just to rename dev file to index.html that way you will always run it by default. And you use predefined index file on your deploy system. Let me know if that helped. SkyzohKey and Ninjadoodle 2 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 5, 2015 Author Share Posted March 5, 2015 Hi @Neso Yeah web servers are definitely not my strong point I try to focus on game making and usually avoid the technical web stuff like the plague. Lately tho, I have been trying to understand it all and have been reading various tutorials. I thought there might be an easy flag or command I could add after running 'http-server' in Terminal, but it looks like it's more complex than that. I think the renaming suggestion is the the most straight forward,without having to dig too much deeper. Thank you for your help! Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted March 5, 2015 Share Posted March 5, 2015 Try install "browser-sync" and type this: browser-sync start --server --files "**/*.js" --no-ghost-mode --no-notify --startPath "dev.html"Save this line into your snip tools or write a function to use it from shell. It will also reload pages when you save any script files. SkyzohKey, drhayes and Ninjadoodle 3 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 5, 2015 Author Share Posted March 5, 2015 Hi @PixelPicoSean Thanks for the suggestion, just had a look at it and looks pretty cool. I'll try and give it a go Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.