Questions tagged as 'express'

1
answer

Express and Express Generator

I understood that the express generator only creates boilerplate pro project. But I do not quite understand what the correct way to add it to the project is I need to install the 2, or just the generator would already suffice? I create th...
asked by 05.08.2018 / 06:43
1
answer

Query parameterized with node.js and knex.js

In the code below I make a query and fetch the contracts that are completed or not, according to the parameter concluido (0 or 1). How do I make this query bring all contracts when the value of the concluido parameter is not p...
asked by 07.12.2016 / 18:10
1
answer

Why do you use expressjs? [closed]

What is it, what is it for and how does express.js work? Is it recommended to use it with AngularJS in a SPA app?     
asked by 26.08.2016 / 17:41
1
answer

Using model.find () with LIKE in mongoose

I have a function here to search MongoDB using mongoose, but I would like it to find Brazil when I search for bra, Bra, Sil, sil, etc. I looked at the documentation and followed the example but it did not work, it does not return anything. Here...
asked by 03.01.2019 / 19:40
1
answer

How to bring an image of a site in the Node API request?

I'm making an application and wanted to give a request that the API bring an image of that site in response. For example, giving the 404 error would like you to bring this . How can I do this? I currently have a method like this: app....
asked by 21.12.2018 / 18:27
2
answers

Mongoose findone does not return values

Well, I have a problem here that I do not know what to try, I'm using express + mongoose. My model let mongoose = require('mongoose'); let users = mongoose.Schema({}, {strict: true}); module.exports = mongoose.model('users', users); My c...
asked by 18.11.2018 / 20:11
1
answer

NODE.JS - Error: Route.get () requires a callback function but got a [object Undefined]

In my roters I create: var express = require('express'); var router = express.Router(); var service = require('./../services/users'); router.get('/login', service.login); router.get('/register', service.register); router.get('/edit/:id',...
asked by 03.11.2018 / 17:07
1
answer

Add data per month using mongoose

Hello! I need to aggregate data per month to use later to make charts. I'm using Mongoose as ODM and the following scheme: module.exports = mongoose.model('atendimento', { id: String, id_atendimento: { type: Number, default: 0 }, i...
asked by 06.08.2018 / 18:55
1
answer

Error escaping a url in js express from a middleware

I have a problem escaping a Url validation of Token . I am using lib jwt (jsonwebtoken) to restrict the access to request of my api, however I want to leave url /imagem/:parametro without validation by token. Because today when I...
asked by 01.11.2018 / 20:59
1
answer

Problems connecting Node Express in Mysql

I know that my project is correct that there is nothing wrong, I think the problem is my newly installed bank, how can I solve this problem? Unhandled rejection SequelizeConnectionError: Client does not support authentication protocol requeste...
asked by 30.07.2018 / 12:48