No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
public
views
.gitignore
CODE_OF_CONDUCT.md
CONTRIBUTING.md
ISSUE_TEMPLATE.md
LICENSE
PULLREQUEST.md
PULL_REQUEST_TEMPLATE.md
README.md
config.json
index.js
package.json

README.md

Bandwidth node-messaging-reference-app

This application is outdated, but will be updated soon!

Install

Before run it fill config file (config.json) with right values:

apiToken and apiSecret - auth data for MMP requests to create an user, an extension, etc,

partner, domain, context - values of MMP path where new user and its data will be created (account with given apiToken and apiSecret should have permissions to work with this partner, this domain and this context),

baseMmpUrl - base url for MMP requests, mmpWebsocketUrl - url for websocket connections (to receive incoming messages) catapultUserId, catapultApiToken, catapultApiSecret - auth data for Catapult API (to search and reserve a phone number, etc), baseUrl - bas eurl of this app.

After that run npm install to install dependencies.

You can run this app as node index.js on local machine if you have ability to handle external requests or use any external hosting.

Deploy on Heroku

NodeJS project on Heroku

Create account on Heroku and install Heroku Toolbel if need.

Open config.json and fill it with valid values (except baseUrl).

Commit your changes.

git add .
git commit -a -m "Deployment"

Run heroku create to create new app on Heroku and link it with current project.

Change option baseUrl in config.json by assigned by Heroku value (something like http://XXXX-XXXXXX-XXXX.heroku.com). Commit your changes by git commit -a.

Run git push heroku master to deploy this project.

Run heroku open to see home page of the app in the browser

Http routes

GET / with redirect to /users
GET /users with HTML response (user's ui)
POST /users {"userName": "" }  with response  {"userName": "", "phoneNumber": "", "uuid": "", "tokens": [{"token": "", "secret": "", "createdAt": ""}]}  to register an user