Created
May 15, 2012 00:02
-
-
Save kevinohara80/2698189 to your computer and use it in GitHub Desktop.
node.js proxy to salesforce REST
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 fs = require('fs'); | |
var bouncy = require('bouncy'); | |
// load up your instance and port into environment variables | |
var instance = (process.env.instance) ? process.instance.env : 'na1'; | |
var port = (process.env.port) ? process.env.port : 443; | |
// self-signed certificate created with openssl | |
var opts = { | |
key : fs.readFileSync(__dirname + '/key.pem'), | |
cert : fs.readFileSync(__dirname + '/certificate.pem') | |
}; | |
// proxy api requests to the salesforce endpoint | |
bouncy(opts, function (req, bounce) { | |
bounce(instance + '.salesforce.com'); | |
}).listen(port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment