Getting the IODocs system running on Heroku required several steps, but once you have them it’s pretty straightforward. So I share them with you here so you can get IODocs running on your own Heroku instance, in the hopes that all of the OAuth APIs out there can leverage this functionality and improve developers’ lives.
Consider this an inclusive set of instructions to the ones they have on the site.
Do the initial IODocs setup <pre>% git clone http://github.com/mashery/iodocs.git % cd iodocs/ % npm install % echo “web: node app.js” > Procfile % cp config.json.sample config.json % vi config.json (remove address line)</pre>
And then this in the Load API Configs section, after reading the config file:
var app = module.exports = express.createServer();
var hostname, port, password
if (process.env.REDISTOGO_URL) { var rtg = require(“url”).parse(process.env.REDISTOGO_URL); hostname = rtg.hostname; port = rtg.port; password = rtg.auth.split(“:”)[1]; } else { hostname = config.redis.host; port = config.redis.port; password = config.redis.password; }
</pre>
Add a LinkedIn block to public/data/apiconfig.json: <pre>“linkedin”: { “name”: “LinkedIn”, “protocol”: “http”, “baseURL”: “api.linkedin.com”, “publicPath”: “”, “privatePath”: “/v1”, “auth”: “oauth”, “oauth”: { “type”: “three-legged”, “requestURL”: “https://api.linkedin.com/uas/oauth/requestToken”, “signinURL”: “https://api.linkedin.com/uas/oauth/authorize?oauth_token=”, “accessURL”: “https://api.linkedin.com/uas/oauth/accessToken”, “version”: “1.0”, “crypt”: “HMAC-SHA1” }, “keyParam”:”” },</pre>
Set up your git repository for heroku <pre>% git init % git add . % git add -f config.json Procfile public/data/* % git commit -m “init”</pre>
<pre></pre>
Once you’ve gotten all this set up, you’re ready to rock. Heroku will give you the right system name and port, and you can use ‘heroku logs’ to check the logs for the node.js server.
You can set up your own APIs using the config file – the IODocs documentation is fantastic, with OCD-level detail on how to set up configurations for new APIs, and I’m certain you can make it work with whatever you’re trying to use.
LINKEDIN · WEB APIS
heroku iodocs linkedin node.js oauth