Skip to content
Example web application built using 1upHealth FHIR & User & Connect APIs
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
components
pages
static
.gitignore
LICENSE
README.md update bashrc load Oct 4, 2018
auth.js
config.json
oneup.js made changes in oneup.jsto add ability to use the same user id in sec… Jul 10, 2018
package-lock.json
package.json
server.js
utils.js

README.md

1up Health Demo Web Application

Example web application built using 1upHealth FHIR, User & Connect APIs

Before you start

Create an application via the 1uphealth devconsole https://1up.health/devconsole for testing purposes. Use http://localhost:3000/callback for your app's callback url. Make sure you save your client secret as it'll only be shown once.

Quickstart

  1. Checkout source code from the repo
cd ~/
git clone https://github.com/1uphealth/1upwebapp.git
  1. Add your API keys to app server session, ex. vim ~/.bashrc or ~/.bash_profile
export ONEUP_DEMOWEBAPPLOCAL_CLIENTSECRET="clientsecretclientsecret"
export ONEUP_DEMOWEBAPPLOCAL_CLIENTID="clientidclientid"

save this

source ~/.bashrc
source ~/.bash_profile
  1. Create config.json configuration file with the same client_id
{
  "baseURL": "http://localhost:3000",
  "clientId": "xxxxxxx",
  "__clientId": "the client id must be hardcoded here because this will be client side",
  "email": {
    "sender": "address@demo.com"
  }
}
  1. Install & run the app
npm install
npm run dev
  1. Run the email server (python 2.7)
sudo python -m smtpd -n -c DebuggingServer localhost:25

Test Health Systems

You can test the demo web app with one of these FHIR health system accounts.

Optional Setup: Setup email using actual email (relay) server

Either run a test local server for development

sudo python -m smtpd -n -c DebuggingServer localhost:25

Or setup email js for production in auth.js

var email 	= require("emailjs");
var server 	= email.server.connect({
   user:    "username",
   password:"password",
   host:    "smtp.your-email.com",
   ssl:     true
});
You can’t perform that action at this time.