generic parse server

14

Click here to load reader

Upload: davidolesch

Post on 22-Jan-2018

93 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Generic Parse Server

Parse Server 101

David Olesch, 2016 1

Page 2: Generic Parse Server

Node.js is easy.Why not code the server yourself?

David Olesch, 2016 2

Page 3: Generic Parse Server

Features

David Olesch, 2016 3

Page 4: Generic Parse Server

How much does it cost to host Parse Server?

David Olesch, 2016 4

Page 5: Generic Parse Server

How long does it take to setup on the back end and front end?

David Olesch, 2016 5

Page 6: Generic Parse Server

Give me the codes

Generic Parse Server on Bitbucket

David Olesch, 2016 6

Page 7: Generic Parse Server

package.js{ "dependencies": { "express": "~4.11.x", "kerberos": "~0.0.x", "parse": "~1.8.0", "parse-server": "~2.2.13", }, "scripts": { "start": "node index.js" }}

David Olesch, 2016 7

Page 8: Generic Parse Server

index.js1 of 2

var express = require('express');var ParseServer = require('parse-server').ParseServer;

var api = new ParseServer({ databaseURI: process.env.DATABASE_URI || 'mongodb://localhost:27017/dev', cloud: __dirname + '/cloud/main.js', appId: process.env.APP_ID || 'AppId', serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse']});var app = express();

David Olesch, 2016 8

Page 9: Generic Parse Server

index.js2 of 2

// Serve the Parse API on the /parse URL prefixvar mountPath = process.env.PARSE_MOUNT || '/parse';app.use(mountPath, api);

var port = process.env.PORT || 1337;var httpServer = require('http').createServer(app);httpServer.listen(port, function() { console.log('parse server running on port ' + port + '.');});

David Olesch, 2016 9

Page 10: Generic Parse Server

How do I run it on Heroku?git push heroku

David Olesch, 2016 10

Page 11: Generic Parse Server

How do I run it locally?npm start

David Olesch, 2016 11

Page 12: Generic Parse Server

How do I add the na,ve SDK to my iOS app?

David Olesch, 2016 12

Page 13: Generic Parse Server

Podfile

target 'MyParseApp' do pod 'Parse' pod 'ParseUI'end

David Olesch, 2016 13

Page 14: Generic Parse Server

AppDelegate.swi-func application(didFinishLaunchingWithOptions: launchOptions) -> Bool {

Parse.initialize(with: ParseClientConfiguration { $0.applicationId = 'AppId' $0.server = 'https://localhost:1337/parse' })

return true}

David Olesch, 2016 14