Skip to content

Latest commit

 

History

History

Example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sample App

This folder contains an example app that demonstrate how to use the CMP SDK package with an expressjs app.

How to run

  1. Install ngrok and set it up. Then run
ngrok http 30000
  1. Go to Welcome and create an app if you don't have one already. Use <your ngrok url>/tests/oauth/callback as the redirect url.

  2. create a .env file, and save the following variables

CMP_CLIENT_ID=<your app client id>
CMP_CLIENT_SECRET=<your app client secret>
  1. Go to the config.js file and update the redirectUri value to <your ngrok url>/tests/oauth/callback.

  2. In another terminal, run the following

cd Example
npm install
npm start
  1. Open your browser and go to localhost:30000 or <your ngrok url>. When you test the OAuth module and test a successful authorization, the tokens will be stored in memory (or in the database if you are using one) and used in other module tests.