Skip to content

Commit

Permalink
Merge pull request #172 from rsksmart/hotfix/DV-590/cors-policy
Browse files Browse the repository at this point in the history
fix: allow external consumption requests
  • Loading branch information
ivegabr authored Nov 27, 2024
2 parents b56d80f + 55ac765 commit d7c7996
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"bignumber.js": "^7.2.1",
"body-parser": "^1.19.0",
"bunyan": "^2.0.4",
"cors": "^2.8.5",
"cron": "^3.1.7",
"express": "^4.17.1",
"prom-client": "^15.1.0",
Expand Down
4 changes: 4 additions & 0 deletions src/api/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import express from 'express'
import apiRoutes from './routes/api'
import docRoutes from './routes/doc'
import config from '../lib/config'
import cors from 'cors'

export const HttpServer = ({ api, status, log }, send) => {
const app = express()
Expand All @@ -11,6 +12,9 @@ export const HttpServer = ({ api, status, log }, send) => {
app.set('etag', false)
app.set('x-powered-by', false)

app.use(cors())
app.options('*', cors())

// status
app.get('/status', (req, res) => {
const data = status.getState().data
Expand Down

0 comments on commit d7c7996

Please sign in to comment.