20 lines
492 B
JavaScript
20 lines
492 B
JavaScript
import express from "express";
|
|
import dotenv from "dotenv";
|
|
import cloudinaryRoute from "./cloudinaryRoute.js";
|
|
import cors from "cors";
|
|
|
|
dotenv.config();
|
|
const app = express();
|
|
|
|
app.use(cors({
|
|
// origin: "https://octopusdesign.fr"
|
|
origin: ["https://octopusdesign.fr", "http://localhost:3000"]
|
|
}));
|
|
|
|
app.use("/api", cloudinaryRoute);
|
|
|
|
const PORT = process.env.PORT || 3001;
|
|
app.listen(PORT, () => {
|
|
console.log(`✅ Serveur backend Cloudinary lancé sur http://localhost:${PORT}`);
|
|
});
|