Hosting a production React app built with Wepback on Heroku
You need to put webpack (as well as any other dependencies that you need on Heroku) under “dependencies” in your package.json, not under “devDependencies”.
You need to put webpack (as well as any other dependencies that you need on Heroku) under “dependencies” in your package.json, not under “devDependencies”.
There is no need for an .env file on Heroku. In fact, such a file won’t work very well since Heroku gets all of its files from your Git repository, has an ephemeral filesystem, meaning that changes to files like .env will be quickly lost, and the .env file won’t be available on other dynos … Read more
heroku doesn’t require the –app argument when it knows which app it should talk to. This occurs when there is exactly one Git remote pointing to Heroku for a repository. You don’t appear to have any remotes pointing to Heroku. Run heroku git:remote –app myapp to add such a remote. Once that’s done you should … Read more
Initialise with git: git init Get the app name: heroku apps Add remote: heroku git:remote -a your_app_name Edit: You can also run commands without permanently adding the app heroku run -a your_app_name
On Heroku, it’s slightly tricky to determine the fact that the request came in over http. https is handled at a heroku routing layer and it passes along the request to the node app on http). This post got me unstuck http://jaketrent.com/post/https-redirect-node-heroku/
Make sure gunicorn is in your requirements.txt
It is true. Heroku allows you to create cloud apps, but those cloud apps are not “permanent” – they are instances (or “slugs”) that can be replicated multiple times on Amazon’s EC2 (that’s why scaling is so easy with Heroku). If you were to push a new version of your app, then the slug will … Read more
Normally setting a config var causes your application to be restarted. In most situations there should be no need to redeploy after doing this. If you really do need to trigger a new deployment you can add a new empty commit, then push to Heroku again: git commit –allow-empty -m “Trigger Heroku deploy after enabling … Read more
Heroku’s asset plugins no longer work since Rails 4 does not support plugins. You need to use Heroku’s asset gems instead. Place this in your Gemfile: group :production do gem ‘rails_log_stdout’, github: ‘heroku/rails_log_stdout’ gem ‘rails3_serve_static_assets’, github: ‘heroku/rails3_serve_static_assets’ end Follow Heroku’s guide on getting started with Rails 4. Update (07/22/2013): Heroku now supplies a different gem … Read more
To really understand the ephemeral filesystem, you need to understand what a dyno is. You can read more about how dynos work. In a nutshell, though, a process runs on Heroku in a virtual machine with its own filesystem. That virtual machine can stop for a number of reasons, taking the filesystem along with it. … Read more