Questions tagged as 'express'

0
answers

Model does not pass JSON to route

My model now works but the JSON does not pass well to the router Model: const USER = module.exports = dynamoose.model('Usuarios', USER_SCHEMA); module.exports.getUserByUsername = function (user, callback) { var docClient = new AWS.Dynamo...
asked by 03.11.2017 / 03:11
2
answers

Use error handler or extend objecto response in express

Good morning, I am doing a REST API project using Express and with the intention of refactoring the code to return the client an error response I do not know which of the following options is more efficient: Use a bug handler as specified i...
asked by 24.10.2017 / 23:37
0
answers

Error Cross origin requests

Trying to consume a service through a web app that I have hosted in heroku , I think the following error: Failed to load localhost:3000/posts/1: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extensi...
asked by 13.10.2017 / 02:51
0
answers

Return variables callbacks and how they are stored in a global variable for validations in sql

I am starting in programming with NodeJs and I have a little problem. I'm doing validations for registering new users on a website. And I'm doing the validation modules so that a certain field is not duplicated. //main.js var mysql=...
asked by 27.09.2017 / 18:05
1
answer

How to route node express to a page with several sections in the html?

Example: [ link When routing like this, var express = require('express'); var home = require('./routes/home'); var bloqueuno = require('./routes/bloqueuno'); var bloquedos = require('./routes/bloquedos'); var bloquetres = require('...
asked by 22.08.2017 / 19:12
1
answer

Redirecting login in nodejs with express

I'm starting with node and express, I would like you to help me with re-addressing problem after login, I do not understand what I could be doing wrong. The code that I have written is this way: This is the routing index file router.get(...
asked by 21.07.2017 / 21:44
1
answer

Registration of MySQL records with NodeJS (Backend) that does not enter "Success" and hangs. That could be happening?

I expose the code to see if someone can help me HTML code with the button that calls the function: <div id="btn_crearcurs" class="btn_curs"> <a class="btn btn-warning btn-lg btn-block" ng-click="crearCursos()">Crear...
asked by 16.08.2017 / 08:56
1
answer

Express middleware Login

I would like to know how I can make the user after login can not return to the login page? I am using Passport.js I can register and login, What I want to achieve is that if you are authenticated and return to login, redirect to / profile....
asked by 26.07.2017 / 03:33
1
answer

NodeJS consume functions that have parameters (res, req) from another file.js

I have the following problem, which I think is very simple, but I am very new to node, so I still have problems with these things. I have a .js file that connects to an external service and makes use of (res and req) and returns it as json....
asked by 17.05.2017 / 23:24
2
answers

How to configure frontend routes with AngularJS and an ExpressJS server?

Good morning, I am currently setting up a SPA application, where I want to manage all the routes with AngularJS and that the Express routes are only for API, the problem I have is that if I configure the Angular routes for example: http://l...
asked by 18.04.2017 / 18:38