From 63de2dd1e0620ce55771a8ead1d7319c3e4aefb8 Mon Sep 17 00:00:00 2001 From: Juan Felipe Torres <42355815+jftorresp@users.noreply.github.com> Date: Tue, 3 Mar 2020 09:46:25 -0500 Subject: [PATCH] =?UTF-8?q?Recomendaci=C3=B3n=20de=20uso=20de=20render()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/routes/index.js b/routes/index.js index f86f9d2..830ba72 100644 --- a/routes/index.js +++ b/routes/index.js @@ -4,6 +4,18 @@ var router = express.Router(); const MongoUtils = require("../db/MongoUtils.js"); const mu = MongoUtils(); +/* Comentario Juan Felipe Torres: no vi ninguno res.render() sino un res.send(). Se recomendaría utilizar la primera oción para no tener +que meter todo un html en el send, mejor definir un archivo html aparte para renderizar el contenido +Sería algo del tipo: +router.get("/ruta", function(req, res) { + mu.connect() + .then(mu.get(test)) + .then(res.render("test": test); +}); +*/ + + + /* GET home page. */ router.get("/getTest", function(req, res) { console.log("Try to connect to Mongo");