another cors config
This commit is contained in:
parent
22d6302118
commit
71d8e95315
|
@ -14,10 +14,10 @@ const sameOriginCorsOpts = {
|
||||||
origin: inProd ? /\.lingdocs\.com$/ : "*",
|
origin: inProd ? /\.lingdocs\.com$/ : "*",
|
||||||
credentials: true,
|
credentials: true,
|
||||||
};
|
};
|
||||||
const openCorsOpts = {
|
// const openCorsOpts = {
|
||||||
origin: "*",
|
// origin: "*",
|
||||||
credentials: false,
|
// credentials: false,
|
||||||
};
|
// };
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// MIDDLEWARE AND SETUP 🔧 //
|
// MIDDLEWARE AND SETUP 🔧 //
|
||||||
|
@ -41,7 +41,7 @@ app.use("/feedback", cors(sameOriginCorsOpts), feedbackRouter);
|
||||||
// TODO: check - does this work with the cors ?
|
// TODO: check - does this work with the cors ?
|
||||||
app.use("/payment", cors(sameOriginCorsOpts), paymentRouter);
|
app.use("/payment", cors(sameOriginCorsOpts), paymentRouter);
|
||||||
// Dictionary API
|
// Dictionary API
|
||||||
app.use("/dictionary", cors(openCorsOpts), dictionaryRouter);
|
app.use("/dictionary", cors(), dictionaryRouter);
|
||||||
|
|
||||||
// START 💨 //
|
// START 💨 //
|
||||||
app.listen(4000, () => console.log("Server Has Started on 4000"));
|
app.listen(4000, () => console.log("Server Has Started on 4000"));
|
||||||
|
|
Loading…
Reference in New Issue