Skip to content

Commit

Permalink
refactor: adjust middleware order
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanycw committed Nov 1, 2023
1 parent 3d3ff2a commit 20f5ba5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/relay/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ async function main() {

const port = process.env.PORT ?? 8000

app.use(express.json())
app.use('/build', express.static(path.join(__dirname, '../keys')))
app.use((req, res, next) => {
res.set('access-control-allow-origin', CLIENT_URL)
res.set('access-control-allow-headers', '*')
next()
})
app.use(express.json())
app.use('/build', express.static(path.join(__dirname, '../keys')))

httpServer.listen(port, () => console.log(`Listening on port ${port}`))

Expand Down

0 comments on commit 20f5ba5

Please sign in to comment.