diff --git a/README.md b/README.md index 8b37f0cb78..5f4ae8744c 100644 --- a/README.md +++ b/README.md @@ -101,11 +101,13 @@ Configuration is located in `config.ts`. [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) +The deploy button reads `app.json` and prompts for the required configuration. Heroku no longer offers the retired mLab add-on used by older versions of this example, so create a MongoDB database first and paste its connection string into `DATABASE_URI` when Heroku asks for config vars. After selecting your Heroku app name, update `SERVER_URL` to match it, for example `https://yourappname.herokuapp.com/parse`. + Alternatively, to deploy manually: * Clone the repo and change directory to it * Log in with the [Heroku Toolbelt](https://toolbelt.heroku.com/) and create an app: `heroku create` -* Use the [mLab addon](https://elements.heroku.com/addons/mongolab): `heroku addons:create mongolab:sandbox --app YourAppName` +* Create a MongoDB database and set its connection string: `heroku config:set DATABASE_URI= --app YourAppName` * By default it will use a path of /parse for the API routes. To change this, or use older client SDKs, run `heroku config:set PARSE_MOUNT=/1` * Deploy it with: `git push heroku master` diff --git a/app.json b/app.json index 022859b272..b1f0da40c8 100644 --- a/app.json +++ b/app.json @@ -1,10 +1,14 @@ { "name": "Parse Server Example", "description": "An example Parse API server using the parse-server module", - "repository": "https://github.com/ParsePlatform/parse-server-example", + "repository": "https://github.com/parse-community/parse-server-example", "logo": "https://avatars0.githubusercontent.com/u/1294580?v=3&s=200", "keywords": ["node", "express", "parse"], "env": { + "DATABASE_URI": { + "description": "MongoDB connection string for Parse Server. Create a MongoDB database before deploying and paste its connection string here.", + "required": true + }, "PARSE_MOUNT": { "description": "Configure Parse API route.", "value": "/parse" @@ -15,13 +19,11 @@ }, "MASTER_KEY": { "description": "A key that overrides all permissions. Keep this secret.", - "value": "myMasterKey" + "generator": "secret" }, "SERVER_URL": { - "description": "URL to connect to your Heroku instance (update with your app's name + PARSE_MOUNT)", - "value": "http://yourappname.herokuapp.com/parse" + "description": "Public URL to connect to your Heroku instance. Update this after choosing the app name, for example: https://yourappname.herokuapp.com/parse", + "value": "https://yourappname.herokuapp.com/parse" } - }, - "image": "heroku/nodejs", - "addons": ["mongolab"] + } } diff --git a/package.json b/package.json index f35183e323..c3214ff5cd 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "lint": "eslint --cache .", "lint-fix": "eslint --cache --fix .", "prettier": "prettier --write '{cloud,spec}/{**/*,*}.{ts,js,mjs,cjs}' index.ts", + "heroku-postbuild": "npm run build", "start": "node dist/index.js", "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=7.0.1} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017", "test": "TESTING=true tsx node_modules/jasmine/bin/jasmine",