Created
May 14, 2020 16:51
-
-
Save fayazara/cd7ea7ba41dda698d3eb4f8c031c1f1c to your computer and use it in GitHub Desktop.
Get Instagram Feed
This file contains hidden or 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
| 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