Questions tagged as 'node.js'

1
answer

MissingSchemaError: Schema has not been registered for model "Product"

Well, I'm following a tutorial on Node.js and MongoDB and I'm trying to create a product, so I create a list of attributes that the objects will have, until everything is ok. Following the video in question, I happen to the same error occurred...
asked by 06.12.2018 / 23:12
1
answer

Request API with JavaScript

I'm doing a web application in which the purpose will be to use an API to just list some information (GET) and for that I would use only javaScript and html. The API is this: link and has key (headers). const app = document.getElement...
asked by 11.12.2018 / 12:48
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

Generate new Error and get this error in the catch of the controller

In my API made in Node , I create the user from a service: exports.create = async(data) => { try { let verifica = await UsuarioModel.findByUsername(data.username); if(verifica) throw new Error('Já existe um usuár...
asked by 18.11.2018 / 23:01
1
answer

Image manipulation with nodejs and ionic

I have an Ionic application, in it I have to send a converted image to base64 for an api, and api to the database. I was getting error by the size of the payload, I found on the internet about using the JSON.stringfy, apparently it worked, howev...
asked by 11.11.2018 / 03:40
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

What is the key for the variables in node.js

Hello, I have a little amateur doubt I'm starting with node.js and through my learning I came across a situation and would like to understand, in one of the codes that I researched I found a variable declared the name in braces as the example be...
asked by 02.11.2018 / 21:59
1
answer

Sending information from a JavaScript site to the NODE.js server

Well, I have a site in javascript where I get information from a Rest API (json) I would like to get this information to my server (A node.js that I created that connects to the database) It's my first time working with web development, wo...
asked by 31.10.2018 / 16:27
1
answer

How to do external file request NodeJS

How do I request an external file with NodeJS? In case it would be an XML ... link     
asked by 21.11.2018 / 21:14
1
answer

Error 500 when performing an authentication request with AdonisJs

I have a SessionController, which is the method that performs the user authentication process in the application. class SessionController { async store ({ request, response, auth }) { const data = request.all() const token = await au...
asked by 03.12.2018 / 00:33