Skip to content

Commit

Permalink
Added cors
Browse files Browse the repository at this point in the history
  • Loading branch information
praveen-kaia committed Jul 22, 2024
1 parent 7e84ef3 commit 4bef4ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var express = require("express");
var app = express();
const fetch = require("node-fetch");
const cors = require("cors");

var StatsData = {};
const { Flipside } = require("@flipsidecrypto/sdk");
Expand All @@ -16,6 +17,8 @@ const COIN_GECKO_URL =
process.env.COINGECKO_API_KEY +
process.env.COIN_GECKO_POSTFIX;

app.use(cors());

app.get("/analytics", async function (req, res) {
return res.status(200).json({ success: true, data: StatsData });
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "ISC",
"dependencies": {
"@flipsidecrypto/sdk": "^2.1.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"node-fetch": "^2.7.0"
Expand Down

0 comments on commit 4bef4ee

Please sign in to comment.