Skip to content

Commit

Permalink
backend(11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibiing committed Dec 17, 2024
1 parent 168c617 commit c02a56d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
15 changes: 12 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ app.use(
helmet({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
defaultSrc: ["'self'", "https://vercel.live"],
scriptSrc: [
"'self'",
"'unsafe-inline'",
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 11 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -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",
},
},
});

0 comments on commit c02a56d

Please sign in to comment.