|
1 |
| -## Deploying to Heroku and mLab |
| 1 | +## Deploying to Heroku and MongoDB Atlas |
2 | 2 |
|
3 |
| -Heroku and mLab provide an easy way to deploy Parse Server, especially if you're new to managing your own backend infrastructure. |
| 3 | +Heroku and MongoDB Atlas provide an easy way to deploy Parse Server, especially if you're new to managing your own backend infrastructure. |
4 | 4 |
|
5 | 5 | Here are the steps:
|
6 | 6 |
|
7 | 7 | 1. Create a repo for your Express app with the Parse Server middleware mounted (you can use our [sample project](https://github.com/parse-community/parse-server-example), or start your own).
|
8 | 8 | 2. Create a Heroku account (if you don’t have one already) and use the Heroku Toolbelt to log in and prepare a new app in the same directory as your Express app. Take a look at Heroku's [Getting Started with Node.js guide](https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction) for more details.
|
9 |
| -3. Use the mLab addon: `heroku addons:create mongolab:sandbox` (or, you can create a Mongo instance yourself, either directly with mLab or your own box) |
10 |
| -4. Use heroku config and note the URI provided by mLab under the var MONGOLAB_URI |
| 9 | +3. Set up your MongoDB database: |
| 10 | + 1. Sign up for a [MongoDB Atlas account](https://www.mongodb.com/cloud/atlas). |
| 11 | + 2. Create a `New Project`. |
| 12 | + 3. Open the page `Database Access` and create a new database user with username and password. Remember these user credentials, you will need them later to connect Parse Server to the database. As user privileges choose `Read and write to any database`, you can change these privileges later on and make them more restrictive according to your needs. |
| 13 | + 4. Open the page `Clusters` and create a new cluster. |
| 14 | + 5. On the cluster details page, click on the tab `Collections` and create a new database. |
| 15 | + 6. On the cluster details page, click on the tab `Command Line Tools`, click on `Connect Instructions` and choose `Connect your application`. |
| 16 | + 7. Copy the database connection string. Replace the placeholders in the connection string with the username and password of the user you created earlier and the database name. |
| 17 | +4. Use heroku config and note the URI provided by Atlas under the var MONGOLAB_URI |
11 | 18 | 5. Copy this URI and set it as a new config variable: `heroku config:set DATABASE_URI=mongodb://...`
|
12 | 19 | 6. Deploy it: `git push heroku master`
|
13 | 20 |
|
|
0 commit comments