Before we can deploy our app, we need to set up a production config for our database. For our database, we will be using MongoDB as an add on service provided in Heroku for free. Enabling this service will pass the location of the MongoDB service as an environment variable to our app and we can use this to connect our app to the database. We will need to tell our app the location of this MongoDB server. Specifying it is as easy as creating a new folder called production under the Config folder and adding a mongo.json file inside of the production folder. To create this config, follow these steps:
- Open the Terminal and, inside the root level of your Vapor project, create a new folder called production inside ...