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
@@ -8,9 +8,97 @@ Parse Server is an [open source version of the Parse backend](http://blog.parse.
8
8
9
9
Parse Server works with the Express web application framework. It can be added to existing web applications, or run by itself.
10
10
11
-
##Getting Started
11
+
# Getting Started
12
12
13
-
The fastest and easiest way to get started is to run MongoDB and Parse Server locally. Once you have a better understanding of how the project works, please refer to the Parse Server guide for in-depth guides to deploy Parse Server to major infrastructure providers.
13
+
The fastest and easiest way to get started is to run MongoDB and Parse Server locally:
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).
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
14
102
15
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:
The standalone Parse Server can be configured using [environment variables](#configuration).
69
-
70
-
You can also install Parse Server globally:
71
-
72
-
`$ npm install -g parse-server`
73
-
74
-
Now you can just run `$ parse-server` from your command line.
75
-
76
-
77
-
## Documentation
135
+
# Documentation
78
136
79
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.
80
138
81
-
####Migrating an Existing Parse App
139
+
## Migrating an Existing Parse App
82
140
83
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).
84
142
85
-
###Configuration
143
+
## Configuration
86
144
87
-
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`. Alternatively, you can use the `PARSE_SERVER_OPTIONS` environment variable set to the JSON of your configuration, If you're using Parse Server on Express, you may also pass these to the `ParseServer` object as options.
88
146
89
147
#### Basic options
90
148
91
-
*`databaseURI` (required) - The connection string for your database, i.e. `mongodb://user:[email protected]/dbname`
92
-
*`appId` (required) - The application id to host with this server instance
93
-
*`masterKey` (required) - The master key to use for overriding ACL security
94
-
*`cloud` - The absolute path to your cloud code main.js file
95
-
*`fileKey` - For migrated apps, this is necessary to provide access to files already hosted on Parse.
149
+
*`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.
150
+
*`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.
151
+
*`databaseURI`**(required)** - The connection string for your database, i.e. `mongodb://user:[email protected]/dbname`.
152
+
*`cloud` - The absolute path to your cloud code `main.js` file.
96
153
*`facebookAppIds` - An array of valid Facebook application IDs.
97
154
*`serverURL` - URL which will be used by Cloud Code functions to make requests against.
98
155
*`push` - Configuration options for APNS and GCM push. See the [wiki entry](https://github.com/ParsePlatform/parse-server/wiki/Push).
@@ -108,36 +165,44 @@ The client keys used with Parse are no longer necessary with Parse Server. If yo
108
165
109
166
#### Advanced options
110
167
111
-
*`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))
112
-
*`databaseAdapter` (unfinished) - The backing store can be changed by creating an adapter class (see `DatabaseAdapter.js`)
113
-
*`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))
114
-
*`enableAnonymousUsers` - Defaults to true. Set to false to disable anonymous users.
115
-
*`allowClientClassCreation` - Defaults to true. Set to false to disable client class creation.
168
+
*`fileKey` - For migrated apps, this is necessary to provide access to files already hosted on Parse.
169
+
*`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)).
170
+
*`maxUploadSize` - Max file size for uploads. Defaults to 20mb.
171
+
*`databaseAdapter` (unfinished) - The backing store can be changed by creating an adapter class (see `DatabaseAdapter.js`).
172
+
*`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)).
173
+
*`enableAnonymousUsers` - Set to false to disable anonymous users. Defaults to true.
174
+
*`allowClientClassCreation` - Set to false to disable client class creation. Defaults to true.
116
175
*`oauth` - Used to configure support for [3rd party authentication](https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#oauth).
117
-
*`maxUploadSize` - Defaults to 20mb. Max file size for uploads
118
176
119
-
####Using environment variables
177
+
### Using a JSON file to configure Parse Server
120
178
121
-
You may also configure the Parse Server using environment variables:
179
+
The standalone API server supports loading a configuration file in JSON format:
122
180
123
-
```js
181
+
```
182
+
$ parse-server path/to/your/config.json
183
+
```
184
+
185
+
### Using environment variables to configure Parse Server
186
+
187
+
You may configure the Parse Server using environment variables:
188
+
189
+
```
190
+
PORT
191
+
PARSE_SERVER_APPLICATION_ID
192
+
PARSE_SERVER_MASTER_KEY
124
193
PARSE_SERVER_DATABASE_URI
194
+
PARSE_SERVER_URL
125
195
PARSE_SERVER_CLOUD_CODE_MAIN
126
-
PARSE_SERVER_COLLECTION_PREFIX
127
-
PARSE_SERVER_APPLICATION_ID// required
128
-
PARSE_SERVER_MASTER_KEY// required
129
-
PARSE_SERVER_CLIENT_KEY
130
-
PARSE_SERVER_REST_API_KEY
131
-
PARSE_SERVER_DOTNET_KEY
132
-
PARSE_SERVER_JAVASCRIPT_KEY
133
-
PARSE_SERVER_DOTNET_KEY
134
-
PARSE_SERVER_FILE_KEY
135
-
PARSE_SERVER_FACEBOOK_APP_IDS// string of comma separated list
136
-
PARSE_SERVER_MAX_UPLOAD_SIZE
137
-
138
196
```
139
197
198
+
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`.
203
+
140
204
##### Configuring File Adapters
205
+
141
206
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/).
142
207
143
208
`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