Questions tagged as 'express'

0
answers

Error PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR

Good, I have a REST API made in NodeJS and ExpressJS and the problem I'm having is that after several hours without making any request, the connection to MYSQL is closed, then when making a request the connection is closed, I get that error and...
asked by 28.03.2017 / 20:50
1
answer

I can not display my mongodb data with mongoose in node.js

//myapp/routes/index.js //declaramos las dependencias var express = require('express'); var bodyParser = require('body-parser'); var mongoose = require('mongoose'), Schema =mongoose.Schema; var router = express.Router(); mongoose.co...
asked by 31.03.2017 / 17:21
1
answer

NodeJS-Express res.json and res.render

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 o...
asked by 13.03.2017 / 21:44
3
answers

ui.router or express to configure the routes of each view

I am trying to develop an application in full-stack JavaScript. I knew the routing system that offers angularjs based on states with ui.router , but I've seen that nodejs has another system to return views with express depending on t...
asked by 26.01.2017 / 20:07
0
answers

How can I upload images to parse server from express

express code app.post('/upload', multipartMiddleware, function(req, resp) { var restaurante = new Parse.Object("Restaurante"); var logo =(req.files.imagen); var file = new Parse.File("logo", req.files.imagen); restaurante.set("logo",...
asked by 06.07.2016 / 22:57
1
answer

I can not join two users to the same room with socket.io

I'm doing an app with express, mongoose, and socket.io. My intention is to make that when a user enters, he joins a room whose name is the name of the city with which he registered. The idea is that when a user A and B belong to the same city,...
asked by 10.05.2016 / 08:18
2
answers

How to concatenate a value with the ORDER BY? - Nodejs

What would be the correct way to concatenate the value that I have in the constant data in my MySQL query? The way I'm doing does not work. const data = req.body; req.getConnection((err, conn) => { conn.query('SELECT * FROM ordenar_usu...
asked by 02.11.2018 / 19:40
1
answer

Create routes for node and Express server

I am creating a server with node, which is the following: var express = require('express'); var app = express(); app.get('/',function(request,res){ res.sendfile('/index.html'); }); app.listen(3000,function(){ console.log('El servidor E...
asked by 14.03.2017 / 20:38
1
answer

I can not do post Node js Router Express

I am using Express and Router to create the links of my api, but for some reason when I try to post it throws me an error 404 , but if you find me any get . When I check the browser console I can see that it does the post with the parameter...
asked by 31.12.2018 / 06:23
2
answers

When using jade extends, is it ajax or does it pretend to be ajax?

For example, I render this view: html head body form(action="/buscar" method="POST") label(for="nombre") Nombre input(type="text" name="nombre") input(type="submit") block contenido h1 usuarios Then in another ro...
asked by 26.07.2016 / 05:49