Questions tagged as 'node.js'

1
answer

MongoDB Model

Hello! I'm starting to use MongoDB with Mongoose in NodeJS and I'm encountering a strange behavior when creating mesus Models in MongoDB. Example: mongoose.connect('mongodb://localhost/db_teste'); const PersonSchema = new Schema({ name: {...
asked by 07.05.2017 / 00:46
1
answer

Node Winston creates log file but does not save: Attempt to write logs with no transports

I have a problem with winston, follow my settings: const logger = winston.createLogger({ level: 'info', format: winston.format.json(), transport: [ new winston.transports.File({ filename: './../error.log', level: 'error', json: true...
asked by 10.10.2017 / 22:32
1
answer

What is the command "res.send ()" in Express?

I am studying NodeJS for academic purposes and during the implementation of a project I came across this command. What is it for?     
asked by 09.10.2017 / 00:42
1
answer

User profiles for REST API access using NodeJS + ORM SequelizeJS

Is there a way, or some nice package, to work with user profiles for access to certain REST API endpoints as per their permission? I'm using NodeJS + Express + SequelizeJS as ORM.     
asked by 05.12.2016 / 16:49
1
answer

create dynamic subdomains in the registry br [closed]

I'm using br register for my site and web system, on the server side I use nodejs and I'm trying to create dynamic subdomains (widcard), when trying to use the nodecard's widcard module it just does not return anything to me. Has anyone worked w...
asked by 01.06.2017 / 19:37
2
answers

What is the correct way to use a package installed by npm? [duplicate]

To explain my question I will use jquery as an example. I installed jquery from npm (npm install jquery). Then npm created the folder node_modules \ jquery \ dist where is the jquery file that I need (jquery.js). To use this file should I p...
asked by 19.11.2016 / 22:26
1
answer

Node.js does not load js nor css scripts

I am making a chat app and I can get the page I want but this page does not load the corresponding css nor the js scripts, does anyone have a solution for this please? So far I have this: Code: server.js: var socket = require( './node_m...
asked by 03.06.2016 / 17:40
1
answer

Angularjs - multiple tabs in same browser

I'm using angularJS in my Node application. When I try to open another tab also with my application in the same browser (or open another instance of the same browser) I get this error: s:1 Uncaught SyntaxError: Unexpected token u in JSON at po...
asked by 06.07.2016 / 17:02
1
answer

How to control the contrast of videos using Electron?

On the left side is my Electron application with a youtube video. On the right side is my application created with pygtk2 and webkit. Contrast is best with webkit. With Electron, the blackboard around the video diverges. How can I solve it?...
asked by 16.06.2016 / 05:29
1
answer

How to call the function again without losing a promise?

I'm still new to Node.Js, and I do not know how to do this. In the code below, you'll notice that the readSubscriptions () function is called shortly after the login () function. However, if a login error occurs, I do not do anything to trea...
asked by 28.12.2016 / 21:39