This file contains hidden or 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
// SUMMARY | |
// 1. New DataStore type will replace the problematic DataStoreType.CACHE | |
// 2. DataStoreType.CACHE will be deprecated | |
// 3. The new DataStore type will be called DataStore.AUTO | |
// 4. DataStoreType.AUTO will be the new default | |
// AUTO data store creation | |
// The AUTO data store will favor operations on the network first | |
// It will only resolve to use the local data store if the network operation cannot complete successfully | |
var store = DataStore.Collection("workorders", DataStoreType.AUTO, KinveyClient.SharedClient); |
This file contains hidden or 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
function onPreSave(request,response,modules){ | |
var accountSid = ""; //TODO - your account Sid | |
var authToken = ""; //TODO - your auth token | |
var rootURL = "https://api.twilio.com/2010-04-01/Accounts/"; | |
var resourceURL = rootURL + accountSid + "/SMS/Messages.json"; | |
var fromNumber = ""; //TODO - source number | |
var toNumber = ""; //TODO - destination number | |
var message = "Hi!"; |
This file contains hidden or 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
<html ng-app=”MyApp”> | |
… | |
<script> | |
var myApp = angular.module("MyApp", ["kinvey"]); | |
myApp.run(function($kinvey) { | |
$kinvey.init({ | |
appKey : "App Key", | |
appSecret : "App Secret" | |
}); | |
}); |
This file contains hidden or 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
function onPostSave(request,response,modules){ | |
var i, to, logger = modules.logger, email = modules.email; | |
for (i = 0; i < request.body.to.length; i++){ | |
to = request.body.to[i]; | |
logger.info("Sending e-mail to: " + to); | |
email.send('[email protected]', | |
to, | |
request.body.subject, | |
request.body.body, | |
request.body.reply_to); |
This file contains hidden or 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
function onPreFetch(request, response, modules){ | |
response.body = {"hello": "world"}; | |
response.complete(200); | |
} |
This file contains hidden or 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 connectString = "mongodb://user:pass@host:port,host:port,host:port/admin?replicaSet=myset&autoReconnect=true&connectTimeoutMS=1500&socketTimeoutMS=3000"; | |
var mongo = require('mongodb'); | |
var async = require('async'); | |
var admin_db; | |
var interval = 6000; | |
var db1; | |
var db2; | |
var simpleQuery = function(callback) { | |
if (db1==null) { |
This file contains hidden or 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 connectString = "mongodb://user:password@hostname_1:30000,hostname_2:30001,hostname_3:30002/admin?replicaSet=myset&autoReconnect=true"; | |
var mongo = require('mongodb'); | |
var async = require('async'); | |
var admin_db; | |
var db1; | |
var db2; | |
var simpleQuery = function(callback) { | |
if (db1==null) { |
This file contains hidden or 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
function onPostSave(request, response, modules) { | |
var to, logger = modules.logger, email = modules.email, body = request.body; | |
for (var i = 0; i < body.invitees.length; i++){ | |
/* assumes the following request JSON body | |
{ | |
"invitees": ["invitee1@gmail.com", "[email protected]"], | |
"subject": "New invitation", | |
"body": "You are invited to this awesome new event. Hope you can make it", | |
"reply_to": "[email protected]" | |
}*/ |
This file contains hidden or 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
function onPostSave(request, response, modules) { | |
var to, logger = modules.logger, email = modules.email, body = request.body; | |
for (var i = 0; i < body.invitees.length; i++){ | |
/* assumes the following request JSON body | |
{ | |
"invitees": ["invitee1@gmail.com", "[email protected]"], | |
"subject": "New invitation", | |
"body": "You are invited to this awesome new event. Hope you can make it", | |
"reply_to": "[email protected]" | |
}*/ |
This file contains hidden or 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
"dependencies": { | |
"mongodb": "git://github.com/Kinvey/node-mongodb-native.git" | |
} |
NewerOlder