Fix CORS
This commit is contained in:
6
index.js
6
index.js
@@ -7,6 +7,12 @@ const middlewares = jsonServer.defaults();
|
||||
|
||||
server.use(middlewares);
|
||||
|
||||
server.use((req, res, next) => {
|
||||
res.header("Access-Control-Allow-Origin", "*"); // update to match the domain you will make the request from
|
||||
res.header("Referrer-Policy", "same-origin");
|
||||
next();
|
||||
})
|
||||
|
||||
server.get("/orderStatuses", (req, res, next) => {
|
||||
setTimeout(() => {
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user