Skip to content

Commit

Permalink
Allow CORS for stats server (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
brittcyr authored Nov 15, 2024
1 parent 7948750 commit 9cd2ac1
Show file tree
Hide file tree
Showing 3 changed files with 342 additions and 3,253 deletions.
2 changes: 2 additions & 0 deletions debug-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@solana/wallet-adapter-react-ui": "^0.9.35",
"@solana/wallet-adapter-wallets": "^0.19.32",
"@solana/web3.js": "^1.95.0",
"cors": "^2.8.5",
"express": "^4.21.0",
"express-prom-bundle": "^7.0.0",
"lightweight-charts": "^4.2.0",
Expand All @@ -39,6 +40,7 @@
},
"devDependencies": {
"@solana/spl-token": "^0.4.8",
"@types/cors": "^2.8.17",
"@types/node": "^22.7.8",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
2 changes: 2 additions & 0 deletions debug-ui/scripts/stats-server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import WebSocket from 'ws';
import { sleep } from '@/lib/util';
import * as promClient from 'prom-client';
import cors from 'cors';
import express, { RequestHandler } from 'express';
import promBundle from 'express-prom-bundle';
import {
Expand Down Expand Up @@ -557,6 +558,7 @@ const run = async () => {
res.send(await statsServer.getVolume());
};
const app = express();
app.use(cors());
app.get('/tickers', tickersHandler);
app.get('/orderbook', orderbookHandler);
app.get('/volume', volumeHandler);
Expand Down
Loading

0 comments on commit 9cd2ac1

Please sign in to comment.