I am doing a mobile client for my application in NodeJS but I do not have much experience doing a REST Web Service, and I am trying to return a JSON in my application to receive it in the Android APP, but I only return a single file type, HTML or JSON but not 2. What can I do? Should I make the WebService part?
getViewIndex(req, res, next){
//console.log(req.user.nombres);
//console.log(req.isAuthenticated());
if(!req.isAuthenticated())
res.redirect('/');
else{
res.render('index', { //envio el html
title: 'Bienvenido',
user: req.user
});
res.json(req.user); //envio el JSON
}
}
Only send the first file, change the order and always send the first one. Thanks in advance.