The Example ORCID Application API is an example API used by example web applications to make calls to the ORCID API. It also serves as the Redirect URI for oauth.
The following environment variables are assumed:
- CLIENT_ID, CLIENT_SECRET - available at ORCID Developer Tools
- SITE_URL - the web site to redirect to (can be overridden by the client specifying a site_url parameter in the authorization link)
- OAUTH_HOST - pub.orcid.org (Public API), pub.sandbox.orcid.org (Public API Sandbox), api.orcid.org (Member API), or api.sandbox.orcid.org (Member API Sandbox)
- OAUTH_PATH - "/oauth/token"
- REDIRECT_URI - https://example-orcid-api.herokuapp.com/auth (update this if you set up your own)
- Make sure you have node.js and git installed on your machine.
- Clone the repository.
- In the application folder run
$ npm install
to install the project dependencies. - (Optional) Install nodemon via the Mac terminal or Gitbash on a PC
$ sudo npm install -g nodemon
- Start node by running
$ node server.js
or$ nodemon server.js
.
To deploy this code to Heroku:
- heroku login example-orcid-api (choose your own since this is taken)
- heroku create (optional app name)
- git push heroku master
- heroku ps:scale web=1
- Set environment variables with "heroku config:set"
Check out a Sandbox Demo.