cmccormack / minesweeper

Simple Minesweeper Game in JS
MIT License
1 stars 3 forks source link

Need hosting solution #11

Open cmccormack opened 4 years ago

cmccormack commented 4 years ago

Need a free hosting solution that can automatically update when a branch is updated. Should support multiple branches.

Some options: Netlify Heroku GH-Pages Glitch Zeit/now

JLuboff commented 4 years ago

I’ll take a look into this one..

JLuboff commented 4 years ago

I'm thinking we go with Heroku. I can write up a basic node backend to serve the app as I don't believe you can deploy just a frontend app by itself. Any one have any opposition?

Additionally I created a generic gmail account FCCMinesweeper@gmail.com that we can share as needed.

bradtaniguchi commented 4 years ago

Whats the advantage of heroku over netlify, or glitch?

JLuboff commented 4 years ago

Heroku has automatic updating when the master branch is updated. Glitch does not as far as I know and I have never worked with netlify, but it does look like they have hooks into your repo like Heroku does. I believe we would still need a server component to serve the app though (someone correct me if I'm wrong)

bradtaniguchi commented 4 years ago

Another thing to consider is to deploy we should have a build step (otherwise we will be building before pushing into git, which is a huge PITA), so either part of the deployment we must be able to run our build step or we setup some kind of CI/CD. (github actions, CircleCI or travis seem like the sensible choices as they are all unlimited for open-source) Part of the CI/CD pipeline can be deployment commands, which makes "push to github" a nice-to-have, not a requirement, as we can push to whatever solution we want once we have CI/CD.

AFAIK the app is just client-side right now, where we just need the built client-side code to be served to the user. So any "client-side hosting" solution should work, since we are just talking about static files. IDK if we need a back-end right now for something like leader boards or something. That would be a scope increase we might do later, but idk right now. (gotta ask @cmccormack )

edit just got an email netlify has their own CI/CD, and I think heroku has something similar?

cmccormack commented 4 years ago

I briefly tested on both Heroku and Netlify. Heroku broke, probably because by default it uses npm start, which is currently our dev server and I doubt they are adding the reverse proxy stuff needed to get to this server. We could play with it a bit and see if we could get it working by adjusting the npm start script.

Netlify appears to have worked immediately. Netlify asks you which command you want to run and where you want to serve the build from which certainly helps in getting it up and running quickly. I'm not certain if Netlify actually tracks updates to the remote repo though - you may need to build manually or setup hooks to get that working automatically. I've not used git hooks in this way but may be interesting to try out. https://www.netlify.com/docs/webhooks/#incoming-webhooks

https://infallible-liskov-6d1d72.netlify.com/

bradtaniguchi commented 4 years ago

One approach we used at work to get our TS nodejs apps to work when the hosting solution uses npm start is to create a separate package.json just for this scenario.

So our current package.json stays the same, but then we move a separate one with 0 dependencies, into the dist, and deploy that. This way our hosting solution just runs pre-compiled code and is up an running faster.