DAS_2024_1/bondarenko_max_lab_3/books/src/index.js

15 lines
403 B
JavaScript
Raw Normal View History

2024-11-25 02:10:37 +04:00
const express = require('express');
const bodyParser = require('body-parser');
const bookRoutes = require('./routes/bookRoutes');
const setupSwagger = require('./swagger');
const app = express();
const port = process.env.PORT || 3001;
app.use(bodyParser.json());
app.use('/books', bookRoutes);
setupSwagger(app);
app.listen(port, () => {
console.log(`Books service is running on port ${port}`);
});