-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
39 lines (32 loc) · 1.12 KB
/
app.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
32
33
34
35
36
37
38
39
// Requires
var express = require('express');
var mongoose = require('mongoose');
//Inicializar Variables
var app = express();
// mongo connection
mongoose.connection.openUri('mongodb://localhost:27017/hospitalDb', (err, res) => {
if (err) { throw err; }
console.log('Mongo Server running at port \x1b[32m%s\x1b[0m', 27017);
});
//Importar Rutas
var appRoutes = require('./Routes/app');
var usuarioRoutes = require('./Routes/usuario');
var loginRoutes = require('./Routes/login');
var hospitalRoutes = require('./Routes/hospital');
var medicoRoutes = require('./Routes/medico');
var busquedaRoutes = require('./Routes/busqueda');
var uploadRoutes = require('./Routes/upload');
var imagenesRoutes = require('./Routes/imagenes');
//Routes
app.use('/usuario', usuarioRoutes);
app.use('/hospital', hospitalRoutes);
app.use('/medico', medicoRoutes);
app.use('/login', loginRoutes);
app.use('/busqueda', busquedaRoutes);
app.use('/upload', uploadRoutes);
app.use('/img', imagenesRoutes);
app.use('/', appRoutes);
// Escuchar peticiones
app.listen(3000, () => {
console.log('Express Server running at port \x1b[32m%s\x1b[0m', 3000);
});