Skip to content

Commit

Permalink
Fix babel not found issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedbennaya committed Oct 6, 2024
1 parent 9343e2a commit f8146c3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ const PORT = process.env.PORT || 4000;
app.use(cors({
credentials: true,
origin: [
"https://mern-site-z5gs.onrender.com","http://localhost:3000"
]
"https://mern-site-z5gs.onrender.com", // Allow your backend domain
"http://localhost:3000", // Allow localhost (for local development)
"https://bargaoui.netlify.app" // Allow your front-end domain on Netlify
],
methods: ['GET', 'POST', 'PUT', 'DELETE'], // Allow these HTTP methods
allowedHeaders: ['Content-Type', 'Authorization'], // Allow custom headers if necessary
}));

// Middleware
Expand All @@ -52,11 +56,12 @@ app.use("/api/cart", cartRoutes);
app.use("/api/uploads", uploadRoutes);
app.use("/api/contact", contactRoutes);
app.use('/api/preferences', preferenceRoutes);

// Error Handling Middleware
app.use(notFound);
app.use(errorHandler);

// Start the server
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
});

0 comments on commit f8146c3

Please sign in to comment.