/cat-watch

Heroku demonstration app forked from 'Bear Watch'.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Cat Watch

About

Heroku demonstration app forked from Bear Watch.

Prerequisite

complete the Trailhead project: Build an Instant Notification App

We make use of the same settings.

make sure you have the same version of node.js

$ node --version
v8.9.1

package.json --> engines --> node

"engines": {
    "node": "8.9.x"
}

create a connected app in your salesforce org, and set the same values.

Login to Salesforce --> Setup --> Apps --> App Manager --> New Connected App

  • Connected App Name: Salesforce Node Client
  • API Name: Salesforce_Node_Client
  • Contact Email: your email address
  • Enable OAuth Settings: Yes
  • Callback URL: https://your-heroku-app.herokuapp.com/auth/callback
  • Selected OAuth Scopes: Access and manage your data (api)

Click the save button and wait for a while. We can make use of the Consumer Key and Consumer Secret.

server/config.js --> config.sfdc --> domain, callbackUrl, consumerKey, consumerSecret, apiVersion

config.sfdc = {
  auth : {
    domain : 'https://login.salesforce.com',    // develper edition
    callbackUrl : 'https://your-heroku-app.herokuapp.com/auth/callback',
    consumerKey : 'xxxxxxxxxxxxxxxxxxxx',
    consumerSecret : 'xxxxxxxxxx',
  },
  data : {
    apiVersion : 'v42.0'
  }
};

create new fields on Notification__e in your salesforce org

Field Label API Name Data Type
Email Email__c Text(255)
Notifier Notifier__c Text(255)

set some value as your secret key

server/config.js --> config.server --> sessionSecretKey

config.server = {
  sessionSecretKey : 'xxxxxxxxxx'
};

deploy to Heroku

$ heroku create --app your-heroku-app
$ git add .
$ git commit -m "initial commit"
$ git push heroku master
$ heroku open --app your-heroku-app

Bear Watch

About

Heroku demonstration app for the "Build an Instant Notification App" Trailhead project (an introduction to platform events).

This application uses the following dependencies (non-exhaustive):

Credits