Updated CORS & serving hosts

This commit is contained in:
2024-08-14 17:53:31 +08:00
parent 082e01599b
commit c79bb5475d
2 changed files with 10 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ let PORT = process.env.APP_PORT;
app.use(
cors({
origin: process.env.CLIENT_URL,
origin: [process.env.CLIENT_URL, "http://localhost:5173"],
})
);
@@ -55,8 +55,8 @@ app.use("/user-vouchers", uservoucher);
db.sequelize
.sync({ alter: true })
.then(() => {
app.listen(PORT, () => {
console.log(`ecoconnect server running at http://localhost:${PORT}/`);
app.listen(PORT, "0.0.0.0", () => {
console.log(`ecoconnect server running at http://0.0.0.0:${PORT}/`);
});
})
.catch((err) => {