Questions tagged as 'express'

1
answer

Generate Json x Search on mongodb

I'm generating a Json. But I have the following situation: I have a contact record that can belong to the same company. That is, I can have two people registered in a single company. How do I load these contacts into my json? I'm doi...
asked by 25.06.2015 / 14:47
1
answer

How to make the node identify the path from the root of the request?

You're like this: <link rel="stylesheet" href="http://localhost/node/softmon/css/style.css" type="css"> If I put it this way: <link rel="stylesheet" href="/css/style.css" type="css"> does not work. I use this to display...
asked by 01.12.2014 / 15:31
0
answers

What are the main design patterns in NODEJS for Web development? [closed]

I'm starting my studies on Nodejs and need to know the main design patterns for Web Development on Nodejs.     
asked by 13.11.2017 / 20:38
1
answer

Why and when to use "res.send ()" in an application? NodeJS and Express

Well, I'm a beginner in NodeJS and I started studying for academic purposes. In another question I made here in SO-BR ( What is the command" res.send () "in Express? ) I asked what this command was for and it was answered very well, but the prob...
asked by 09.10.2017 / 01:35
0
answers

Configuration of Response Headers

I created a server in Express and my client in Quasar / VueJS. I need to send a PDF to my client, the PDF in question is already created on the server, but I'm having trouble sending it to the client. I'm using Axios to make client-side requests...
asked by 15.08.2017 / 15:05
0
answers

How to check if the EJS is responding

My application is node with express and ejs 1 - It is running index.html and not index.ejs 2 I am not able to pass the title or title parameter to the view, neither in ejs nor in html app.js and index.ejs look like this: var express = re...
asked by 05.07.2017 / 09:20
1
answer

List of values in a session using NodeJS

I'm using the express-session and express modules and I need to create a list of values in an item in a session so that at some point you can add values to it. Ex: req.session.category="Include key and value in this property" Could som...
asked by 29.03.2017 / 20:35
0
answers

How to optimally handle errors in Mongoose

I'm starting to work with MongoDB + Mongoose and I'm having trouble dealing with the errors that mongoose generates. One of the same is when there is a duplicate key for a parameter that should be unique. Ex: Model (UserModel) const mongo...
asked by 03.04.2017 / 06:05
0
answers

How the Express Router Function Works

To use middleware in Express, I type the code below: var express = require('express'); var app = express(); app.use('/', function(req, res, next) { console.log('Middleware!'); }); However, I realized that it is also possible to do thi...
asked by 01.05.2016 / 16:42
1
answer

TypeError: ExtractJwt.fromAuthHeader is not a function

I'm having some problems with Passaport.js. When I try to run my api, the terminal returns an error. I went in the file in question and did not find anything wrong. I searched the net, but the solutions I found left the code to what I have...
asked by 17.08.2017 / 19:34