Questions tagged as 'express'

0
answers

Error when querying API in Angular

Good morning, I'm trying to access my API by angular through the get of the http module, my files are in my github repository if someone wants to take a look. I'm following this tutorial here to make the request, but always gives the...
asked by 01.06.2018 / 18:38
1
answer

Access one module from another

Well, I'm learning how to implement MVC with the Express framework, but I came across the following situation in my app.js file: var express = require('express'); var consign = require('consign'); var bodyParser = require('body-parser'); var...
asked by 22.05.2018 / 15:31
0
answers

No Access-Control-Allow-Origin header is present on the requested resource. - MEAN STACK

Hello! I need to pass a string to the node and I'm getting the following response from the browser console: Failed to load http://localhost:3003/api/buscarCep: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origi...
asked by 09.05.2018 / 02:42
0
answers

Improve the performance of nodemailer with express (Node.JS)

Well I created an application in Node.js for sending emails via form, to test site I was using FakeSMTP , and the performance was up to speed, but after I "dockerizei" I realized that the return in the sendmail function is taking more than 5 se...
asked by 07.05.2018 / 22:30
1
answer

NodeJs file is undefined

Save Galley! Try to help me please, I'm new to NodeJs and express and I'm not getting the input file in my ejs, when I send the route already arrives as undefined. Server.js file var express = require('express'); var app = express(); var bo...
asked by 01.05.2018 / 02:40
0
answers

Make Schema field unique for a single field

I have a problem that I am breaking the head: I'm developing a REST API that uses MongoDB and I need Mongoose to not allow insertion via POST into the database fields that are not unique when linked to an ID. Example: {'_id': '1234', 'fi...
asked by 12.04.2018 / 21:54
0
answers

file.mv is not working on Heroku

I'm doing an API with node.js for file transfer to a CDN however when running the function: file.mv(name, (error) => { It returns the following error: { "message": "Falha ao processar sua requisição", "data": { "errn...
asked by 11.09.2018 / 20:13
0
answers

Handle Transactions - Node, mysql

I am developing a POC where I need to register a sale. For this, I use this code: this.salvarVenda = function(connection, objeto, response, callback){ let sqlVenda = utilVenda.createSaveQuery(objeto); console.log(sqlVenda);...
asked by 30.03.2018 / 18:27
1
answer

Model, Express and Mongoose

I have the following code in express.js const express = require('express'); const load = require('express-load'); module.exports = () => { var app = express(); var bodyParser = require('body-parser'); //variável de ambiente app.set('po...
asked by 13.03.2018 / 21:55
1
answer

Set localStorage in different domains

I have three applications: 1. Login (running on port 8080) with very simple jQuery 2. API (running on port 4000) with Nodejs 3. Web (which runs on port 4200) with Angular When I log in and click "Log In", it will call the API,...
asked by 13.03.2018 / 11:08