-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
21 lines (17 loc) · 795 Bytes
/
server.js
File metadata and controls
21 lines (17 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import 'reflect-metadata'
import express from 'express';
import appBodegas from './routers/bodega.js';
import appProducto from './routers/producto.js';
import appInventarios from './routers/inventario.js';
import {proxyBodegas} from './Middlewars/proxyBodegas.js'
import { proxyInventarios } from './Middlewars/proxyInventario.js'
import { proxyProductos } from './Middlewars/proxyProductos.js';
const appServer = express();
appServer.use(express.json());
appServer.use('/bodegas',proxyBodegas, appBodegas);
appServer.use('/productos',proxyProductos, appProducto);
appServer.use('/inventarios',proxyInventarios, appInventarios);
const config = JSON.parse(process.env.MYCONFIG);
appServer.listen(config, () => {
console.log(`Server is running on http://${config.host}:${config.port}`);
});