Skip to content

Commit

Permalink
Primer commit
Browse files Browse the repository at this point in the history
  • Loading branch information
matibm committed Nov 26, 2019
0 parents commit 26225e5
Show file tree
Hide file tree
Showing 4 changed files with 1,406 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
33 changes: 33 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Requires
var express = require('express');
var mongoose = require('mongoose');


// Inicializar variables
var app = express();



// Conexion a la base de datos
mongoose.connection.openUri('mongodb://localhost:27017/hospitalDB', (err, res) => {
if (err) throw err;
console.log("Base de datos: \x1b[32m%s\x1b[0m", ' online');

})


// Rutas
app.get('/', (req, res, next) => {
res.status(200).json({
ok: true,
messaje: 'Peticion realizada correctamente'
})
})



// Escuchar peticiones
app.listen(3000, () => {
console.log('Express server puerto 3000: \x1b[32m%s\x1b[0m', ' online');

})
Loading

0 comments on commit 26225e5

Please sign in to comment.