You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.
22
+
23
+
That's it! You are now running a standalone version of Parse Server on your machine.
24
+
25
+
**Using a remote MongoDB?** Pass the `--databaseURL DATABASE_URI` parameter when starting `parse-server`. Learn more about configuring Parse Server [here](#configuration). For a full list of available options, run `parse-server --help`.
26
+
27
+
### Saving your first object
28
+
29
+
Now that you're running Parse Server, it is time to save your first object. We'll use the [REST API](https://parse.com/docs/rest/guide), but you can easily do the same using any of the [Parse SDKs](https://parseplatform.github.io/#sdks). Run the following:
Keeping tracks of individual object ids is not ideal, however. In most cases you will want to run a query over the collection, like so:
68
+
69
+
```
70
+
$ curl -X GET \
71
+
-H "X-Parse-Application-Id: APPLICATION_ID" \
72
+
http://localhost:1337/parse/classes/GameScore
73
+
```
74
+
```json
75
+
// The response will provide all the matching objects within the `results` array:
76
+
{
77
+
"results": [
78
+
{
79
+
"objectId": "2ntvSpRGIK",
80
+
"score": 1337,
81
+
"playerName": "Sean Plott",
82
+
"cheatMode": false,
83
+
"updatedAt": "2016-03-11T23:51:48.050Z",
84
+
"createdAt": "2016-03-11T23:51:48.050Z"
85
+
}
86
+
]
87
+
}
88
+
89
+
```
90
+
91
+
To learn more about using saving and querying objects on Parse Server, check out the [Parse documentation](https://parse.com/docs).
92
+
93
+
### Connect your app to Parse Server
94
+
95
+
Parse provides SDKs for all the major platforms. Refer to the Parse Server guide to [learn how to connect your app to Parse Server](https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#using-parse-sdks-with-parse-server).
96
+
97
+
## Running Parse Server elsewhere
98
+
99
+
Once you have a better understanding of how the project works, please refer to the [Parse Server wiki](https://github.com/ParsePlatform/parse-server/wiki) for in-depth guides to deploy Parse Server to major infrastructure providers. Read on to learn more about additional ways of running Parse Server.
100
+
101
+
### Parse Server Sample Application
12
102
13
103
We have provided a basic [Node.js application](https://github.com/ParsePlatform/parse-server-example) that uses the Parse Server module on Express and can be easily deployed using any of the following buttons:
14
104
15
-
<atitle="Deploy to AWS"href="https://console.aws.amazon.com/elasticbeanstalk/home?region=us-west-2#/newApplication?applicationName=ParseServer&solutionStackName=Node.js&tierName=WebServer&sourceBundleUrl=https://s3.amazonaws.com/elasticbeanstalk-samples-us-east-1/eb-parse-server-sample/parse-server-example.zip"target="_blank"><imgsrc="http://d0.awsstatic.com/product-marketing/Elastic%20Beanstalk/deploy-to-aws.png"height="40"></a> <atitle="Deploy to Heroku"href="https://heroku.com/deploy?template=https://github.com/parseplatform/parse-server-example"target="_blank"><imgsrc="https://www.herokucdn.com/deploy/button.png"></a> <atitle="Deploy to Azure"href="https://azuredeploy.net/?repository=https://github.com/parseplatform/parse-server-example"target="_blank"><imgsrc="http://azuredeploy.net/deploybutton.png"></a>
105
+
<atitle="Deploy to AWS"href="https://console.aws.amazon.com/elasticbeanstalk/home?region=us-west-2#/newApplication?applicationName=ParseServer&solutionStackName=Node.js&tierName=WebServer&sourceBundleUrl=https://s3.amazonaws.com/elasticbeanstalk-samples-us-east-1/eb-parse-server-sample/parse-server-example.zip"target="_blank"><imgsrc="http://d0.awsstatic.com/product-marketing/Elastic%20Beanstalk/deploy-to-aws.png"height="32"></a> <atitle="Deploy to Heroku"href="https://heroku.com/deploy?template=https://github.com/parseplatform/parse-server-example"target="_blank"><imgsrc="https://www.herokucdn.com/deploy/button.png"></a> <atitle="Deploy to Azure"href="https://azuredeploy.net/?repository=https://github.com/parseplatform/parse-server-example"target="_blank"><imgsrc="http://azuredeploy.net/deploybutton.png"></a>
The standalone Parse Server can be configured using [environment variables](#configuration).
67
-
68
-
You can also install Parse Server globally:
69
-
70
-
`$ npm install -g parse-server`
71
-
72
-
Now you can just run `$ parse-server` from your command line.
73
-
74
-
75
-
## Documentation
135
+
# Documentation
76
136
77
137
The full documentation for Parse Server is available in the [wiki](https://github.com/ParsePlatform/parse-server/wiki). The [Parse Server guide](https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide) is a good place to get started. If you're interested in developing for Parse Server, the [Development guide](https://github.com/ParsePlatform/parse-server/wiki/Development-Guide) will help you get set up.
78
138
79
-
####Migrating an Existing Parse App
139
+
## Migrating an Existing Parse App
80
140
81
141
The hosted version of Parse will be fully retired on January 28th, 2017. If you are planning to migrate an app, you need to begin work as soon as possible. There are a few areas where Parse Server does not provide compatibility with the hosted version of Parse. Learn more in the [Migration guide](https://github.com/ParsePlatform/parse-server/wiki/Migrating-an-Existing-Parse-App).
82
142
83
-
###Configuration
143
+
## Configuration
84
144
85
-
The following options can be passed to the `ParseServer` object during initialization. Alternatively, you can use the `PARSE_SERVER_OPTIONS` environment variable set to the JSON of your configuration.
145
+
Parse Server can be configured using the following options. You may pass these as parameters when running a standalone `parse-server`, or by loading a configuration file in JSON format using `parse-server path/to/configuration.json`. If you're using Parse Server on Express, you may also pass these to the `ParseServer` object as options.
146
+
147
+
For the full list of available options, run `parse-server --help`.
86
148
87
149
#### Basic options
88
150
89
-
*`databaseURI` (required) - The connection string for your database, i.e. `mongodb://user:[email protected]/dbname`
90
-
*`appId` (required) - The application id to host with this server instance
91
-
*`masterKey` (required) - The master key to use for overriding ACL security
92
-
*`cloud` - The absolute path to your cloud code main.js file
93
-
*`fileKey` - For migrated apps, this is necessary to provide access to files already hosted on Parse.
151
+
*`appId`**(required)** - The application id to host with this server instance. You can use any arbitrary string. For migrated apps, this should match your hosted Parse app.
152
+
*`masterKey`**(required)** - The master key to use for overriding ACL security. You can use any arbitrary string. Keep it secret! For migrated apps, this should match your hosted Parse app.
153
+
*`databaseURI`**(required)** - The connection string for your database, i.e. `mongodb://user:[email protected]/dbname`.
154
+
*`cloud` - The absolute path to your cloud code `main.js` file.
94
155
*`facebookAppIds` - An array of valid Facebook application IDs.
95
156
*`serverURL` - URL which will be used by Cloud Code functions to make requests against.
96
157
*`push` - Configuration options for APNS and GCM push. See the [wiki entry](https://github.com/ParsePlatform/parse-server/wiki/Push).
@@ -106,36 +167,38 @@ The client keys used with Parse are no longer necessary with Parse Server. If yo
106
167
107
168
#### Advanced options
108
169
109
-
*`filesAdapter` - The default behavior (GridStore) can be changed by creating an adapter class (see [`FilesAdapter.js`](https://github.com/ParsePlatform/parse-server/blob/master/src/Adapters/Files/FilesAdapter.js))
110
-
*`databaseAdapter` (unfinished) - The backing store can be changed by creating an adapter class (see `DatabaseAdapter.js`)
111
-
*`loggerAdapter` - The default behavior/transport (File) can be changed by creating an adapter class (see [`LoggerAdapter.js`](https://github.com/ParsePlatform/parse-server/blob/master/src/Adapters/Logger/LoggerAdapter.js))
112
-
*`enableAnonymousUsers` - Defaults to true. Set to false to disable anonymous users.
113
-
*`allowClientClassCreation` - Defaults to true. Set to false to disable client class creation.
170
+
*`fileKey` - For migrated apps, this is necessary to provide access to files already hosted on Parse.
171
+
*`filesAdapter` - The default behavior (GridStore) can be changed by creating an adapter class (see [`FilesAdapter.js`](https://github.com/ParsePlatform/parse-server/blob/master/src/Adapters/Files/FilesAdapter.js)).
172
+
*`maxUploadSize` - Max file size for uploads. Defaults to 20mb.
173
+
*`databaseAdapter` (unfinished) - The backing store can be changed by creating an adapter class (see `DatabaseAdapter.js`).
174
+
*`loggerAdapter` - The default behavior/transport (File) can be changed by creating an adapter class (see [`LoggerAdapter.js`](https://github.com/ParsePlatform/parse-server/blob/master/src/Adapters/Logger/LoggerAdapter.js)).
175
+
*`enableAnonymousUsers` - Set to false to disable anonymous users. Defaults to true.
176
+
*`allowClientClassCreation` - Set to false to disable client class creation. Defaults to true.
114
177
*`oauth` - Used to configure support for [3rd party authentication](https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#oauth).
115
-
*`maxUploadSize` - Defaults to 20mb. Max file size for uploads
116
178
117
-
#### Using environment variables
179
+
```
180
+
181
+
### Using environment variables to configure Parse Server
118
182
119
-
You may also configure the Parse Server using environment variables:
183
+
You may configure the Parse Server using environment variables:
120
184
121
-
```js
185
+
```
186
+
PORT
187
+
PARSE_SERVER_APPLICATION_ID
188
+
PARSE_SERVER_MASTER_KEY
122
189
PARSE_SERVER_DATABASE_URI
190
+
PARSE_SERVER_URL
123
191
PARSE_SERVER_CLOUD_CODE_MAIN
124
-
PARSE_SERVER_COLLECTION_PREFIX
125
-
PARSE_SERVER_APPLICATION_ID// required
126
-
PARSE_SERVER_MASTER_KEY// required
127
-
PARSE_SERVER_CLIENT_KEY
128
-
PARSE_SERVER_REST_API_KEY
129
-
PARSE_SERVER_DOTNET_KEY
130
-
PARSE_SERVER_JAVASCRIPT_KEY
131
-
PARSE_SERVER_DOTNET_KEY
132
-
PARSE_SERVER_FILE_KEY
133
-
PARSE_SERVER_FACEBOOK_APP_IDS// string of comma separated list
134
-
PARSE_SERVER_MAX_UPLOAD_SIZE
135
-
136
192
```
137
193
194
+
The default port is 1337, to use a different port set the PORT environment variable:
For the full list of configurable environment variables, run `parse-server --help`.
199
+
138
200
##### Configuring File Adapters
201
+
139
202
Parse Server allows developers to choose from several options when hosting files: the `GridStoreAdapter`, which backed by MongoDB; the `S3Adapter`, which is backed by [Amazon S3](https://aws.amazon.com/s3/); or the `GCSAdapter`, which is backed by [Google Cloud Storage](https://cloud.google.com/storage/).
140
203
141
204
`GridStoreAdapter` is used by default and requires no setup, but if you're interested in using S3 or GCS, additional configuration information is available below.
0 commit comments