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
// Example express application adding the parse-server module to expose Parse | |
// compatible API routes. | |
var express = require('express'); | |
var ParseServer = require('parse-server').ParseServer; | |
var http = require('http'); | |
if (!process.env.DATABASE_URI) { | |
console.log('DATABASE_URI not specified, falling back to localhost.'); | |
} |
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
'use strict'; | |
// A RestWrite encapsulates everything we need to run an operation | |
// that writes to the database. | |
// This could be either a "create" or an "update". | |
var deepcopy = require('deepcopy'); | |
var Auth = require('./Auth'); | |
var cache = require('./cache'); |
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
var counter = 0; | |
var Primus = require('primus'); | |
var Socket = new Primus.createSocket({ | |
transformer: 'websockets' | |
}); | |
setInterval(function() { | |
var client = Socket('https://blooming-shore-2447.herokuapp.com/'); | |
client.on('open', function(){ | |
client.id = ++counter; |
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
var http = require('http'); | |
var server = http.createServer(); | |
var Primus = require('primus'); | |
var primus = new Primus(server, { | |
transformer: 'websockets' | |
}); | |
primus.on('connection', function connection(spark) { | |
console.log("Client has connected"); |