Skip to content
Jitendra Zaa edited this page Apr 6, 2017 · 3 revisions

Complete source code to showcase using Lightning component in node.js (External websites) by using Lightning Out. It shows how to enable CORS and SSL in Node.js with Video and complete source code.

Jitendra Zaa Blog

Click here for Youtube Video demo

Blog post explaining code

Steps to run

Step 1

Create below Lightning application in your Salesforce instance and name it as LightningOutDemo

<aura:application access="Global" extends="ltng:outApp">

<aura:dependency resource="forceChatter:feed" type="COMPONENT" />

</aura:application>

Step 2

Create Connected App in your Salesforce instance with callback URL - https://localhost:8081/ Copy consumer secret created in connected app and update clientId variable defined in OAuth.js file.

Step 3

Save https://localhost:8081 in CORS setting of Salesforce.

Step 4

Run npm install command in the directory where this code is downloaded. It will download all the required node modules then run npm start, it will start the server

Step 5

Navigate to https://localhost:8081/ in your browser and you would see Lightning Out in Action

Clone this wiki locally