Skip to content

Commit

Permalink
Merge pull request #842 from TrooperCrypto/master
Browse files Browse the repository at this point in the history
add CORS
  • Loading branch information
0xtrooper authored Jul 20, 2023
2 parents b9fd0ce + c2b613e commit db2a73e
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 db2a73e

Please sign in to comment.