ShiftSync/api/server.js
2025-06-05 00:43:00 -04:00

21 lines
No EOL
460 B
JavaScript

import express from 'express';
import cors from 'cors';
import dotenv from 'dotenv';
dotenv.config();
import { postgresServices } from './services/postgres/postgresServices.js';
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');
});