Code Monkey home page Code Monkey logo

et_lwc_out_nodejs's Introduction

Demo: Lightning Out + Visualforce/Node.js + LWC/Aura (Node.js Server)

What is this?

This is one of two repos that will help you get started with Lightning Out in Visualforce and Node.js application to render Lightning Components both Aura and LWC.

This repo contains the Node.js server built using Typescript, express and ejs.

The two GitHub projects are:

How to use it?

Make sure you get both repos, then get the scratch org ready and execute the Node.js server.

How to create the org?

  • Create a scratch org by executing this command ./@ELTOROIT/scripts/CreateOrg.sh
  • At the end of that script, it creates the pasword for the user and displays some important information. Make sure you keep that open (if you close it, you can execute sfdx force:user:display).
  • On the Scratch org that was created, reset the security token for API connections.

How to configure the Node.js application?

  • First, rebuild the node_modules folder by executing npm install
  • Open VS Code and find the .env file
  • Update the content using the information at the end of the script that creates the scrach org and the security token.
  • Start the web server, by hitting F5
  • Once it has compiled, open a web browser and navigate to either http://localhost:5000 or https://localhost:5001

Note: The Node.js web server is using a self-signed certificate which is required for HTTPS, but obviously is not secured. When you open the "secured" site, the browser is going to report a warning but you can bypass it and get to the content. When you deploy this to a real server, and use a good certificate, this problem will not happen any more.

Why am I doing this?

Great question...

First of all, I am very excited about everything that came out on Summer '19 around LWC, specially Lighting Out because my site (http://ELTORO.IT) was build using this many years ago with Aura.

Second, it was a bit more difficult than I had thought... specially because there is not a lot of information and I used quite a long list of technologies (Node.js, Typescript, express, ejs, SSL certificates, Lightning out, ...) to put this together. I just want to share this solution with you, and hopefully help you save all the time I spent putting this together.

Note

This uses two GitHub projects:

Credits

Web documents that I read to help me build this:

Typescript with Node and Express

Lightning Out

SSL Certificates

et_lwc_out_nodejs's People

Contributors

eltoroit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.