Skip to content
Andrew Fawcett edited this page Sep 6, 2017 · 1 revision

Welcome to the deploy-to-sfdx wiki!

Running locally with SSL

To develop the HTTP referer support you need to run locally under HTTPS as browsers do not exchange this header value between HTTPS (GitHub) and HTTP.

  1. Create a certification in the root
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days XXX

Refer to this page and the section Creating your SSL Certificate.

  1. Add the following to app.js
const app = express();
const router = express.Router();
  1. Add the following to the bottom of app.js
var sslOptions = {
  key: fs.readFileSync('key.pem'),
  cert: fs.readFileSync('cert.pem'),
  passphrase: 'yourcertpass'
};
https.createServer(sslOptions, app).listen(443);
  1. Run local

To run local with port 443, you have to use sudo (or if your concerned on security use another port)

sudo heroku local
  1. You will need to use a Connected App with https://localhost/oauth/callback as the callback, ensure to update the .env file with the new oAuth secrets.
Clone this wiki locally