From 605f83c36a52cffd5486071986a6709a2fad6a11 Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Thu, 18 Feb 2016 17:56:39 -0800 Subject: [PATCH] Updated readme with deploy buttons --- README.md | 77 ++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 3ca2801f..d7ccd2f0 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,38 @@ Parse Server works with the Express web application framework. It can be added t Read the announcement blog post here: http://blog.parse.com/announcements/introducing-parse-server-and-the-database-migration-tool/ +## Getting Started + +[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/parseplatform/parse-server-example) +[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/?repository=https://github.com/parseplatform/parse-server-example) + + +You can create an instance of ParseServer, and mount it on a new or existing Express website: + +```js +var express = require('express'); +var ParseServer = require('parse-server').ParseServer; +var app = express(); + +// Specify the connection string for your mongodb database +// and the location to your Parse cloud code +var api = new ParseServer({ + databaseURI: 'mongodb://localhost:27017/dev', + cloud: '/home/myApp/cloud/main.js', // Provide an absolute path + appId: 'myAppId', + masterKey: '', //Add your master key here. Keep it secret! + fileKey: 'optionalFileKey', + serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed +}); + +// Serve the Parse API on the /parse URL prefix +app.use('/parse', api); + +app.listen(1337, function() { + console.log('parse-server-example running on port 1337.'); +}); +``` + ## Documentation Documentation for Parse Server is available in the [wiki](https://github.com/ParsePlatform/parse-server/wiki) for this repository. The [Parse Server guide](https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide) is a good place to get started. @@ -20,10 +52,8 @@ If you're interested in developing for Parse Server, the [Development guide](htt 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. Learn more in the [Migration guide](https://github.com/ParsePlatform/parse-server/wiki/Migrating-an-Existing-Parse-App). - --- - #### Basic options: * databaseURI (required) - The connection string for your database, i.e. `mongodb://user:pass@host.com/dbname` @@ -106,48 +136,8 @@ For more informations about custom auth please see the examples: * 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)) * enableAnonymousUsers - Defaults to true. Set to false to disable anonymous users. - - --- -### Usage - -You can create an instance of ParseServer, and mount it on a new or existing Express website: - -```js -var express = require('express'); -var ParseServer = require('parse-server').ParseServer; - -var app = express(); - -var port = process.env.PORT || 1337; - -// Specify the connection string for your mongodb database -// and the location to your Parse cloud code -var api = new ParseServer({ - databaseURI: 'mongodb://localhost:27017/dev', - cloud: '/home/myApp/cloud/main.js', // Provide an absolute path - appId: 'myAppId', - masterKey: '', //Add your master key here. Keep it secret! - fileKey: 'optionalFileKey', - serverURL: 'http://localhost:' + port + '/parse' // Don't forget to change to https if needed -}); - -// Serve the Parse API on the /parse URL prefix -app.use('/parse', api); - -// Hello world -app.get('/', function(req, res) { - res.status(200).send('Express is running here.'); -}); - -app.listen(port, function() { - console.log('parse-server-example running on port ' + port + '.'); -}); - -``` - - #### Standalone usage You can configure the Parse Server with environment variables: @@ -169,8 +159,7 @@ PARSE_SERVER_FACEBOOK_APP_IDS // string of comma separated list ``` - -Alernatively, you can use the `PARSE_SERVER_OPTIONS` environment variable set to the JSON of your configuration (see Usage). +Alternatively, you can use the `PARSE_SERVER_OPTIONS` environment variable set to the JSON of your configuration (see Usage). To start the server, just run `npm start`.