Trishthedish / DuwamishApp

Dynamic website aimed at bringing awareness around Duwamish tribes potential extinction.
3 stars 5 forks source link

Move off of Heroku / Express, stay static #98

Open ivanoats opened 8 years ago

ivanoats commented 8 years ago

On free plans on Heroku, the server dyno spins down between web site accesses. This makes the site initially unresponsive when you first access it, if you're the first person visiting it in a while.

The free dyno is only available a maximum of 18 hours per day.

Currently the express server does not do anything beyond serving static web pages. This could be more efficiently served on a static host such as Aerobatic. It includes free and automatic Content Delivery Network (CDN) setup, so pages load faster for visitors.

Aerobatic also has an API proxy feature that would allow us to include easy API forwarding to other services on the web without worrying about CORS.

If we need complex backend features, these could still be put on Heroku in a separate back-end only repo.

Moving to hosting on Aerobatic would be a copy of the repo on Bitbucket, but it is easy to treat as another remote, just like heroku. So instead of git push heroku master it would be git push bb master - or call the remote anything you like, like production.

Let's make the site speedier to visitors, more easily scalable, and cheaper to host.

AndyCErnst commented 8 years ago

Yeah, sounds great. I'd love to deploy to production with one command. But I don't understand how you can push the dist folder to bitbucket when it's in the .gitignore. Also, how can we get rid of the .html on our urls?

ivanoats commented 8 years ago

Check out the "Stripping file extensions" section of https://www.aerobatic.com/docs/redirects

Deploying to production with one command - that's what grunt/gulp's for, right? It's also built into HexoJS, there is a command there too.

ivanoats commented 8 years ago

re /dist - easiest thing is to remove it from .gitignore. Or an orphan branch, but that's more work.