-
Notifications
You must be signed in to change notification settings - Fork 0
4. Hosting on the cloud (Heroku)
If you prefer to have the server available at all times, you can spin it up on a hosted cloud provider. Here, I'll be showing you how to do it with Heroku and the Heroku CLI tool. This is not a Heroku tutorial, it is expected that you know the basics of Heroku, so I won't be going much in details.
Navigate to a forked version of the repository and run the following commands.
heroku create
heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
git push heroku master
Depending on which adapter you're using for DB_ADAPTER
, follow the following instructions.
The FS adapter uses the file-system of your Heroku app to store your database as a JSON file. This is the adapter used by default and requires no configuration. You're all set!
Appart from the fs
adapter, redis
is the most simple adapter to setup with Heroku. All you need to do is add the add-on and it will add Redis to your app and the REDIS_URL
config var.
# Installs the free package of Heroku Redis
heroku addons:create heroku-redis:hobby-dev
Using the MongoDB adapter is a bit more complicated than Redis. You can follow the article I used myself to setup MongoDB for this project.
When your database is setup, add the MONGO_URL
config var to your Heroku app with your connection URI. Make sure your database is set to accept connections from anywhere, rather than a single IP. (Unless you know the IP of your Heroku instance)