diff --git a/server.js b/server.js index bd0dbee..30131e6 100644 --- a/server.js +++ b/server.js @@ -24,7 +24,7 @@ app.use( helmet({ contentSecurityPolicy: { directives: { - defaultSrc: ["'self'"], + defaultSrc: ["'self'", "https://vercel.live"], scriptSrc: [ "'self'", "'unsafe-inline'", @@ -38,13 +38,16 @@ app.use( ], styleSrc: ["'self'", "'unsafe-inline'"], imgSrc: ["'self'", "data:", "https:"], - connectSrc: ["'self'", "https://chronocamm.vercel.app"], + connectSrc: [ + "'self'", + "https://chronocamm.vercel.app", + "https://vercel.live", + ], }, }, referrerPolicy: { policy: "strict-origin-when-cross-origin" }, }) ); - // Database Connection const connectDB = async () => { try { @@ -95,6 +98,12 @@ app.use(passport.session()); // Routes setupAuthRoutes(app); +app.get("/", (req, res) => { + res.status(200).json({ + message: "Server is running", + status: "healthy", + }); +}); app.use("/auth", manualAuthRoutes); app.use("/api", userRoutes); app.use("/upload", uploadRoutes); diff --git a/vite.config.js b/vite.config.js index 8b0f57b..cc8be4c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,15 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; // https://vite.dev/config/ export default defineConfig({ plugins: [react()], -}) + server: { + proxy: { + "/api": "http://localhost:8080", + "/auth": "http://localhost:8080", + "/upload": "http://localhost:8080", + "/images": "http://localhost:8080", + }, + }, +});