Name: elite2-proxy-util
Owner: NOMS Digital Studio
Description: Proxy that adds the gateway token for easier dev use
Created: 2017-10-24 08:24:30.0
Updated: 2017-10-24 08:52:23.0
Pushed: 2017-10-24 08:52:22.0
Homepage: null
Size: 10
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Proxy that adds the gateway token for easier dev use.
Add the following environment variables, optionally in .env:
NOMIS_GW_TOKEN - your gateway token
NOMIS_GW_KEY - your private key, base64 encoded
yarn start
Use a REST client
Calls to
http://localhost:3002/elite/some/real/path
will have the gateway token header added and be proxied to
https://realserver/some/real/path
Target host can be set in config.js.
Port can be set via environment variables.
Path re-write rules can be sett in the proxy options in app.js.
eg
POST http://localhost:3002/elite/elite2api/users/login with header Content-type=application/json wih body {“username”:“use yours”,“password”:“use yours”}
then for subsequent requests use
header {“elite-authorization”:“Bearer token.from.login”}