ShiftSync/api/server.js

25 lines
No EOL
550 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",
"https://shift-dev.code-catalyst.com",
"https://shift.code-catalyst.com"
]
};
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');
});