I have a project here that is on github. I created a gh-pages branch to make it hosted on github pages. The link they gave me to my hosted site is here.
I am pretty new to web apps and especially new to MEAN stack web apps. My question is - how can I access my web app now that it is hosted via github? Obviously the hosted link gives a 404 error because I don't have an index.html file in the root of the project. The "html" I have in the project is in the views folder and has an "ejs" file extension (index.ejs).
To run this app on my local machine I start an npm server:
npm start
Then I navigate to http://localhost:3000/#/home in a browser to see the app.
Is it even possible to host this app on github pages? Do I need to modify my project in some way to make it work? Also - I know I will have to change the mongoose database pointer for the database portion to work. Any pointers in the right direction would be greatly appreciated!
The easiest one. You should consider this if your site is fully static and its repo is hosted on GitHub. To enable it, just go to the repository settings (general tab), select a branch to deploy and set it. Once enabled, the branch selected will be served as static files over https.
Did you know that Github will allow anyone to host their static webpages for free? The best part is that you can even use your own custom domain. Let's do this!
Github does not host nodejs instances.
If you want to host a it on GitHub pages you can follow these steps:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With