Example web application built using 1upHealth FHIR, User & Connect APIs
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.
- Checkout source code from the repo
cd ~/
git clone https://github.com/1uphealth/1upwebapp.git
- Add your API keys to app server session, ex.
vim ~/.bashrc
export ONEUP_DEMOWEBAPPLOCAL_CLIENTSECRET="clientsecretclientsecret"
export ONEUP_DEMOWEBAPPLOCAL_CLIENTID="clientidclientid"
- 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"
}
}
- Install & run the app
npm install
npm run dev
- Run the email server
sudo python -m smtpd -n -c DebuggingServer localhost:25
You can test the demo web app with one of these FHIR health system accounts.
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
});