Last active
July 22, 2018 23:12
-
-
Save zpv/e06708027d796fd6b35c63f437a3357f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GitHub Middlelayer | |
const app = require('express')(); | |
const request = require('request'); | |
const github_api = "https://api.github.com"; | |
const key = 'OUATH_TOKEN'; | |
const auth_header = '"Authorization: token OAUTH-TOKEN"'; | |
app.get('*', (req, res, next) => { | |
var options = { | |
url: github_api + req.path, | |
headers: { | |
'Authorization': 'token ' + key, | |
'User-Agent': 'node.js' | |
} | |
}; | |
request(options, (err, resp, body) => { | |
res.send(JSON.parse(body)); | |
}) | |
}); | |
app.listen(3000, () => console.log('Example app listening on port 3000!')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment