Updated CORS & serving hosts
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from "vite";
|
||||||
import react from '@vitejs/plugin-react'
|
import react from "@vitejs/plugin-react";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
})
|
server: {
|
||||||
|
host: "0.0.0.0",
|
||||||
|
port: 5173,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ let PORT = process.env.APP_PORT;
|
|||||||
|
|
||||||
app.use(
|
app.use(
|
||||||
cors({
|
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
|
db.sequelize
|
||||||
.sync({ alter: true })
|
.sync({ alter: true })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, "0.0.0.0", () => {
|
||||||
console.log(`ecoconnect server running at http://localhost:${PORT}/`);
|
console.log(`ecoconnect server running at http://0.0.0.0:${PORT}/`);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user