2025-06-05 04:43:00 +00:00
|
|
|
import express from 'express';
|
|
|
|
|
import cors from 'cors';
|
|
|
|
|
import dotenv from 'dotenv';
|
|
|
|
|
dotenv.config();
|
|
|
|
|
import { postgresServices } from './services/postgres/postgresServices.js';
|
2025-06-05 04:02:22 +00:00
|
|
|
|
|
|
|
|
const app = express();
|
|
|
|
|
|
|
|
|
|
const corsOptions = {
|
|
|
|
|
origin: ["http://localhost:5173"]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
app.use(cors(corsOptions));
|
|
|
|
|
|
|
|
|
|
app.get("/api", (req, res) => {
|
|
|
|
|
res.json({ fruits: ["apple", "orange", "banana"] });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.listen(5172, () => {
|
|
|
|
|
console.log('Server Started on port 5172');
|
|
|
|
|
});
|