Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
endpoint: GitHub Repos (superagent)
node v6.17.1
version:
1.0.0
endpoint
share
tweet
GitHub Repos - Endpoint test
const request = require("superagent") let token = process.env.GITHUB_TOKEN exports.endpoint = (req, res) => { request .get("https://api.github.com/repos/gorilla/mux") .then(resp => { console.log("done!") res.end(JSON.stringify(resp.body)) }) .catch(err => { console.log(err) res.end(JSON.stringify(`error: ${err}`)) }) }
Loading…
no comments
sign in
to comment