feat(api): register swagger docs route
This commit is contained in:
27
backend/server.js
Normal file
27
backend/server.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import express from 'express';
|
||||||
|
import cors from 'cors';
|
||||||
|
import { initDB } from './db/init.js';
|
||||||
|
import cvRoutes from './routes/cv.js';
|
||||||
|
import authRoutes, { initAuth } from './routes/auth.js';
|
||||||
|
import docsRoutes from './routes/docs.js';
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
const PORT = process.env.PORT || 3001;
|
||||||
|
|
||||||
|
initDB();
|
||||||
|
initAuth();
|
||||||
|
|
||||||
|
app.use(cors());
|
||||||
|
app.use(express.json());
|
||||||
|
|
||||||
|
app.use('/api/auth', authRoutes);
|
||||||
|
app.use('/api/cv', cvRoutes);
|
||||||
|
app.use('/api', docsRoutes);
|
||||||
|
|
||||||
|
app.get('/health', (req, res) => {
|
||||||
|
res.json({ status: 'ok', timestamp: new Date().toISOString() });
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log(`CV Backend running on port ${PORT}`);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user