-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (22 loc) · 909 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require('dotenv').config();
const express = require('express');
const tokenRoutes = require('./routes/tokenRoutes');
const bodyParser = require('body-parser'); // Asegúrate de importar body-parser
const redisRoutes = require('./routes/redisRoutes');
const rabbitmqRoutes = require('./routes/rabbitmqRoutes');
const app = express();
app.use(express.json());
// Middleware para analizar el cuerpo de la solicitud como JSON
app.use(bodyParser.json()); // Para analizar solicitudes JSON
// Registra las rutas
app.use('/', tokenRoutes);
app.use('/api/tokens', tokenRoutes);
app.use('/api/redis', redisRoutes);
app.use('/api/rabbitmq', rabbitmqRoutes);
// app.use('/api/tokens', tokenRoutes);
// app.use('/api/redis', redisRoutes);
// app.use('/api/rabbitmq', rabbitmqRoutes);
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Servidor corriendo en el puerto ${PORT}`);
});