Skip to content

Commit

Permalink
feat: Configure CORS origin (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio authored Apr 17, 2024
1 parent f800500 commit 33243a5
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ const app = express()
app.set("x-powered-by", false)
app.use(withLogs())
app.use("/api", [
withCors(),
withCors({
corsOrigin: [
/^http:\/\/localhost:[0-9]{1,10}$/,
/^https:\/\/(.{1,50}\.)?decentraland\.(zone|today|org)$/,
"https://mvfw.org",
"https://dcl-metrics.com",
],
allowedHeaders: "*",
}),
withDDosProtection(),
withBody(),
status(),
Expand All @@ -69,8 +77,12 @@ app.use("/events", social)

app.use("/events", [
withCors({
cors: "*",
corsOrigin: "*",
corsOrigin: [
/^http:\/\/localhost:[0-9]{1,10}$/,
/^https:\/\/(.{1,50}\.)?decentraland\.(zone|today|org)$/,
"https://mvfw.org",
"https://dcl-metrics.com",
],
allowedHeaders: "*",
}),
gatsby(resolve(__filename, "../../public"), {
Expand Down

0 comments on commit 33243a5

Please sign in to comment.