Skip to content

Instantly share code, notes, and snippets.

@fayazara
Created May 14, 2020 16:51
Show Gist options
  • Select an option

  • Save fayazara/cd7ea7ba41dda698d3eb4f8c031c1f1c to your computer and use it in GitHub Desktop.

Select an option

Save fayazara/cd7ea7ba41dda698d3eb4f8c031c1f1c to your computer and use it in GitHub Desktop.
Get Instagram Feed
const express = require("express");
const app = express();
const axios = require("axios");
const cors = require("cors");
app.use(cors());
app.get("/", async (_, res) => {
const api = `https://graph.instagram.com/me/media?fields=id,media_type,media_url,caption&access_token=${process.env.SECRET}`;
const { data } = await axios.get(api);
res.send(data);
});
// listen for requests :)
const listener = app.listen(process.env.PORT, () => {
console.log("Your app is listening on port " + listener.address().port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment