forked from BloomBooks/bloom-parse-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# bloom-parse-server | ||
|
||
This is the database backend for bloom-library.org, using the [parse-server](https://github.com/ParsePlatform/parse-server) module on Express. | ||
This is the database backend for bloom-library.org, using the [parse-server](https://github.com/ParsePlatform/parse-server) module. | ||
|
||
Here is the full [Parse Server guide](https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide). | ||
|
||
|
@@ -34,7 +34,7 @@ Here is the full [Parse Server guide](https://github.com/ParsePlatform/parse-ser | |
parse-dashboard --appId myAppId --masterKey "123" --serverURL | ||
``` | ||
This will say it is available at http://0.0.0.0, but actually it is at http://localhost. | ||
This will respond that it is available at http://0.0.0.0, but actually it is at http://localhost. | ||
1. Setup or update the mongodb Schema | ||
|
@@ -61,3 +61,45 @@ curl -X POST \ | |
-d '{}' \ | ||
http://localhost:1337/parse/functions/hello | ||
``` | ||
### Azure Setup | ||
We are running three different services: | ||
* bloom-parse-server-unittest | ||
* bloom-parse-server-develop | ||
* bloom-parse-server-production | ||
Each is backed by a single mongodb at mlab.com. This is how they were made: | ||
1. Create the mongodb on mlab.com, making sure to select Azure and the same datacenter. Failing to do this increases response times by 3x. | ||
2. In Azure, create a new "Web App" App Service | ||
3. In Azure:App Service:Application Settings, create these settings: | ||
DATABASE_URI mongodb://account:[email protected]:port/database | ||
APP_ID you make this up. | ||
MASTER_KEY you make this up | ||
SERVER_URL http://<app service name>.azurewebsites.net/parse | ||
Note: Don't leave off that /parse in the SERVER_URL! | ||
REST API: parse.com used this (not clear what the actual environment variable would be) but as far as I can tell, the open source Parse-Server does not. | ||
4. In Azure:App Service:Deployment Options, point it at this github repository, | ||
with the appropriate branch. A few minutes later, parse-server will be running. Note that Azure apparently does the `npm install` automatically, as needed. | ||
Not also that it automatically redepoys when github notifies it of a checkin on the branch it is watching. | ||
Question: does the service shut down while this is happening? | ||
5. We never touch the schema using the Parse Dashboard or letting queries automagically add clases or fields. | ||
Instead, we set up the schema using a Cloud Code function `setupTables`. | ||
If you haven't set up the database already, follow instructions shown above under "Setup or update the mongodb Schema". | ||
Use Azure:App Service:Log stream to monitor progress. | ||
Note: During one setup, I found this can be flaky, perhaps becuase I jumped the gun. | ||
So instead I did the curl post for `functions/testDB`, which worked. | ||
Then I tried `functions/setupTables` again, and this time it worked. | ||
6. TODO: Backup, Logging setup. |