Questions tagged as 'express'

2
answers

What are middleware in NodeJS?

What are middleware and what is its importance to the Node platform?     
asked by 18.05.2015 / 16:41
1
answer

Passport Session Authentication on Android

I have a web app running with NodeJS, Express and authentication with Passport-JS, and everything works perfectly. Now I'm developing an Android app and I need to authenticate my users using the same API. From what I understand by reading...
asked by 14.12.2016 / 13:05
1
answer

Receive parameter in delete request

I am trying to pass a parameter to my DELETE request, I tried to do the following: Use the same way I use in GET (where it works normal). app.delete('/contatos', function(req, res){ var obj = req.body; console.log(obj); }); Howev...
asked by 01.09.2015 / 04:51
2
answers

How do I set a token in the header?

Well I use jwt to generate a token only because the example I was following did not show exactly how to collocate the token in the application header. Would anyone know how? Note: I'm using express. app.js // part of the main file app.use(f...
asked by 23.09.2015 / 04:46
2
answers

Is it possible to restrict access to variable information with AngularJs?

Hello, I'm new to development and would like to know if there is any way to hide variable information in AngularJs, I'm using a MongoLab API and I did not want to leave my apiKey visible to anyone who debug the code in the browser, I'm runnin...
asked by 14.10.2015 / 05:44
1
answer

File upload callback with Multer - NodeJS

Hello, has anyone used the multer (express / nodeJS module) to perform file uploads? If yes how did you catch the callback events (onFileUploadStart and onFileUploadComplete)? Theoretically I'm using correctly but at no time are events called .....
asked by 27.07.2015 / 22:16
1
answer

How to use passport.js on node to log in against the database

How to use passport.js to control access using the database and express.js middleware. How to make login logic and how to know that the session is already authorized when the user has already logged in?     
asked by 12.09.2015 / 22:56
1
answer

Ajax POST with jQuery and Node.js Express always returning 404: Not Found

I created the route below to accept POST requests, but calls via AJAX for this route are always returning error 404: Not Found. /* Arquivo: integracoes.js */ var express = require('express'); var router = express.Router(); // Esta rota funcio...
asked by 08.10.2015 / 02:16
1
answer

Go through a method on all routes of all http methods except two

Basically I want to make all routes that come from any http method (get, post, put, ...) first pass by a method that will check if the user is authenticated, but this method should not be called when the user will authenticate (method POST...
asked by 02.06.2018 / 19:19
1
answer

How to run different Node.js sites on the same server?

I have a Linux server and on this server I have several hosted sites, each with its own folder and files. I want to start using Node.js to create the APIs for each site. What is the best way to do this? A process and port for each site or a s...
asked by 12.11.2016 / 14:36