joblist front
This commit is contained in:
parent
08bb8deec5
commit
344fccac45
4 changed files with 48 additions and 8 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue