joblist front

This commit is contained in:
quasar 2025-05-30 13:52:45 +02:00
parent 08bb8deec5
commit 344fccac45
4 changed files with 48 additions and 8 deletions

View file

@ -1,15 +1,23 @@
import express from 'express';
import dotenv from 'dotenv';
import cors from 'cors';
import jobIngestionRoutes from './routes/jobIngestionRoutes';
import jobSearchRoutes from './routes/jobSearchRoutes';
import { ingestJobOffers } from './controllers/jobIngestionController';
import { startJobIngestionScheduler } from './utils/jobScheduler'; // <-- AJOUTE CETTE LIGNE
import { startJobIngestionScheduler } from './utils/jobScheduler';
dotenv.config();
const app = express();
const PORT = process.env.PORT || 3000;
// Configuration CORS
app.use(cors({
origin: 'http://localhost:5173', // URL du frontend
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization'],
}));
app.use(express.json());
app.use(jobIngestionRoutes);
@ -18,5 +26,5 @@ app.post('/api/ingest-jobs', ingestJobOffers);
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
startJobIngestionScheduler(); // <-- AJOUTE CETTE LIGNE
startJobIngestionScheduler();
});