Changed origin to variable passed when running the container. Limited to only POST method.
This commit is contained in:
+3
-2
@@ -9,10 +9,11 @@ const app = express();
|
|||||||
const PORT = 8081;
|
const PORT = 8081;
|
||||||
|
|
||||||
const corsOptions = {
|
const corsOptions = {
|
||||||
origin: "http://frontend:3000",
|
origin: "${FRONTEND_URI}",
|
||||||
methods: "GET,PUT,POST",
|
methods: "POST",
|
||||||
credentials: true,
|
credentials: true,
|
||||||
};
|
};
|
||||||
|
//methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
|
||||||
|
|
||||||
app.use(cors(corsOptions));
|
app.use(cors(corsOptions));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user