简体   繁体   中英

Connecting Parse-Server to Heroku

Hey I'm having trouble connecting my Parse-Server to my Heroku app. I've been following this: https://github.com/parse-community/parse-server and I've done the first step for installing it locally by using npm install -g parse-server mongodb-runner which worked fine. However, the following steps to set up my AppID, MasterKey and MongoDB databaseURI don't work. I have all of these things already as I've used parse-server-example, however running this command parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test with the correct information hasn't worked for me, and I don't know what file to put my keys in. If someone could help me that would be very much appreciated as I just went in circles on this for 9+ hours today. Thank you!

When I try node index.js

When I try npm install

Cloud Code Error

You should put your keys in index.js file. To run parse server locally, you need to use node index.js in your command line.

If you want to connect to heroku, you need to make a Procfile (simply touch Procfile ), then add web: npm start into the file.

After you push to Heroku, go to settings, reveal config vars, then put all your keys there.

在此处输入图片说明

Both DATABASE_URI and MONDODB_URI should be your mongodb url(not local). SERVER_URL should be the heroku app url.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM