Skip to content

Commit

Permalink
Merge pull request #843 from ZigZagExchange/master
Browse files Browse the repository at this point in the history
add CORS
  • Loading branch information
0xtrooper authored Jul 20, 2023
2 parents c369419 + db2a73e commit 4398fd3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/httpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ export const createHttpServer = (socketServer: WebSocketServer): ZZHttpServer =>
const expressApp = express() as any as ZZHttpServer
const server = createServer(expressApp)

expressApp.use('/', (req, res, next) => {
res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
res.header('Access-Control-Allow-Methods', 'GET, POST')
next()
})

const httpMessages = [
'requestquote',
'submitorder',
Expand Down

0 comments on commit 4398fd3

Please sign in to comment.