15 lines
403 B
JavaScript
15 lines
403 B
JavaScript
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}`);
|
|
}); |