Questions tagged [express]

Express is a minimal and flexible Node.js web application framework, providing a robust set of features for building web applications. https://expressjs.com

1
vote
1answer
24 views

Show pop up only first time user login in express framework

I'm using Express the Node.JS framework, and cookies for authentication. How can I show a pop up for the user's first login only?
0
votes
0answers
21 views

How to use the data from external api in my local express server? [duplicate]

I have installed, request and request-promise from npmjs to fetch data from external API into my local express server. I'm getting data but I'm not able to import that data in another file to use. I'...
1
vote
0answers
12 views

retrieve an image from mongodb and display it using angular7

i have uploaded image using multer with disk storage in project folder i have only filename i.e filename: "1561256874022.jpg" while from mongo i am getting this object destination: "C:\Users\Me\...
0
votes
0answers
7 views

NestJS: Where is the most reasonable place to write logs at a debug level?

My team and I are lost in deep thoughts for a couple of days to figure out the right place for writing a debug-level log during development. We're using winston and winston-daily-rotate-file to ...
0
votes
1answer
44 views

Passing NodeJS data to Javascript

I have a web application with a client that receives data from a server. I have the data in NodeJS, but I want to pass the data to a Javascript file. The Javascript file is included in a HTML file, so ...
0
votes
0answers
7 views

SequlizeJS connection get timeout frequently

We have a project backend running on NodeJS / expressJS / SequilizeJS as a RESTapi. That RESTapi connceted to a VueJS SPA. Only 5 people use this system. Most of the operations are transactions. We ...
0
votes
0answers
9 views

How can we log every http request and response and save it to database in express

I am trying to save all the incoming request and their response into the database. I am trying to achieve this using express-winston npm package and it is logging response body and request in ...
0
votes
1answer
15 views

Cannot redirect after insertion

I want to redirect to a url after the insert is success : $(document).ready(function() { $("#btn").on("click", function() { $.post({ url:"/track/admin/...
0
votes
1answer
16 views

How to create a liking system in NodeJS and React?

I created a 'Secrets' project and each secret can be liked/unliked by the users. The problem is that it should be incrementing everytime the user triggers the 'like' button. For some reason it does ...
0
votes
0answers
15 views

How do I use ejs with frontend javascript/webpack? [duplicate]

I am fairly new to nodejs/express. I am fairly new to programming in general. I come from a PHP background mainly. Anyways, I am using ejs as a templating engine for a node/express project of mine. ...
-1
votes
0answers
12 views

How to get a link to download videos on Twitter in all sizes in node.js

I apply node.js to download videos from social media sites and I was able to download videos from YouTube and Facebook but I could not do this via Twitter. Some libraries have already used the node ...
0
votes
1answer
14 views

Get image from localhost to localhost with express and nodejs

I´m building an app with NodeJs and Angular The server runs on http://localhost:9000 And the app runs on http://localhost:4200 I have an endpoint whose looks like this http://localhost:9000/users I ...
-1
votes
1answer
12 views

Using JWT + Express for password reset feature

I am trying to create a reset password feature on my website that uses a React front-end and an Express + Nodejs backend. To do this, I am sending an email with a JWT token containing a user id. When ...
1
vote
0answers
20 views

Inject environment config to angular app at runtime using webpack?

We follow CI/CD approach. So same build is required for QA and production. Thus unable to use angular environment files(fileReplacements) for configuration variables as build are different. I choose ...
0
votes
0answers
11 views

What is the significance, if any of port 9229, and can it be changed?

By default, I was taught, when I run a local Node server to run it on port 3000. After reading a tutorial on the Chrome Node debugger which is set to inspect port 9229, I switched to this port. Here ...
0
votes
1answer
12 views

UnhandledPromiseRejectionWarning : Express async try and catch block error

Trying to make an API call, but I get (node:20774) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch ...
1
vote
1answer
14 views

React/Express Reads Locally but Cannot Be Found in Heroku

I deployed my React/Express application to Heroku after checking that it ran locally with no issues. However, upon deployment to Heroku, the application is no longer working. I receive a 404 error and ...
1
vote
0answers
9 views

Send email with nodemailer, and insert form data into mysql db

Trying to setup a form that receives user input for a beta testing email list, which will send me an email with the user's information, and store the same form data into a mysql database. I have the ...
0
votes
1answer
13 views

download empty file in express

I'm new to node.js, can anyone help me with my code. the code below can write the query result into 'public/out.csv' file on the server end, but it downloads an empty into the client end. I have no ...
-2
votes
1answer
25 views

Convert the syntax to async-await

I would like to convert the syntax to async-await. is it worthy? how can I do it? router.get('/user', middlewareJwt.jwtHandler, function (req, res) { UserService.get(req.userId, (user) =&...
0
votes
0answers
12 views

Mongoose closing connection on request

I have a node application using express and mongoose. It connects fine, but when I try to read or write in the database, the function does not end, does not throw any error and does not modify the ...
0
votes
0answers
8 views

How do I create an authorization access key?

I have tried so many different tools, but I cannot seem to create an authorization key. Specifically an OAuth2 flow to generate an access token. I've tried using Postman but I am confused. I am using ...
0
votes
0answers
4 views

Full Oauth2 Authentication Flow with Vue.js Client and Express.js Server Using Passport.js

I have a problem understanding how to use the Bearer Access Token received from an OAuth2 authentication flow. In my case the client is Vue.js, the server is Express.js and the authentication middle ...
0
votes
0answers
8 views

NextJs / Express TypeError: _typeof is not a function in _app.js

I was working for a while on the project with next.js, but when time come to deploy live I start getting an odd behavior from the express. I am using next.js, express as backend server, and redux with ...
0
votes
0answers
6 views

How can I add entity to relation only with ID without fetching it?

I am creating a Many-To-Many relation @Entity({ name: 'product' }) export class Product { @PrimaryGeneratedColumn() id: number; @Column() name: string; @Column({type: '...
0
votes
0answers
19 views

getting empty array in response res.json(); in nodejs code

Why does res.json respond with an empty array? I want to get all data from collection distributor ,so for that I have created model file and then assigned it to on variable Distributordata ...
-1
votes
1answer
25 views

ExpressJS not call ajax get method

I created a sample ExpressJS App by using Express Application Generator I want to call localhost:3000/data to get some data. I added these code to app.js: app.get('/data', function(req, res){ ...
0
votes
0answers
10 views

TypeError: Cannot read property 'left' of undefined

I am trying to solve the graph datastructure problem of hacker rank. My method should return the minimal cost of providing libraries to all. Providing my hacker rank question here https://www....
2
votes
0answers
16 views

How can I use Dialogflow-fulfillment library while utilizing the serverless architecture?

I'm setting up a lambda function using serverless that will be invoked through a Webhook in Google's NLP Dialogflow. My end goal is to be able to use the dialogflow-fulfillment library. I have tried ...
1
vote
1answer
15 views

How does passport.js deserializeUser decrypt the hashed session data?

After a user logs in by sending a POST to say /login, then passport will attach a session cookie, so that a persistent session is established. This is done via the serializeUser function. Then express-...
0
votes
0answers
19 views

Sending response to generated session

I'm wiriting my application in Android, but i don't know how to send response only to device whos generated session with special ID in express-session. For example, i have 3 phones and click at the ...
0
votes
0answers
14 views

NodeJS error : Missing writing permission

I am trying to setup express application generator and am running into the following error: I am not able to understand why the writing access is being denied and so many errors are occurring. ...
0
votes
1answer
40 views

How to fix PUT request slow and long page reload time?

I'm learning React.js and trying to apply it to my Todolist page which used ejs for the front-end. I use checkbox to send todo's id to the server's PUT request. Checking multiple boxes (I assume ...
0
votes
0answers
18 views

Trying to get logout button to return to home page. Using passport

The logout function works correctly. It takes you to the google sign in page after you click log out. Im trying to have the sign out button return to the home page instead of seeing google log in page ...
0
votes
1answer
18 views

how i can fix the SequelizeDatabaseError: Field 'id' doesn't have a default value?

im working on a To do list in node using MVC node express pug and sequelize as ORM and the views part i made it with pug, so when i start my app works ok but when i try to create a new proyect and ...
0
votes
1answer
11 views

How can I get axios to maintain cookies/session between API calls?

I'm having trouble maintaining session state between axios calls in my NodeJS app. Here is the relevant code: const express = require("express") const cors = require("cors") const app = express() ...
0
votes
1answer
26 views

Error in passing data to ejs file from mysql database

I have EJS file in which i want to pass data from MySQL database. My codes as are mentioned below my javascript file module.exports={ printSlipPage:(req, res)=>{ let trans1ID = req....
0
votes
1answer
19 views

Is it possible to build hidden areas / React-Components based on serverside data?

We need to build an application where some users are allowed to access some pages, other users are not allowed to. As this ain't enough, we have some components on that pages (buttons, links) which ...
-3
votes
0answers
13 views

Unable to get the body object from mongodb

I am unable to retrieve the body during delete request. app.delete('/blogs/:id',function(req,res){ console.log(req.body) Blog.findByIdAndRemove(req.params.id,function(){ res.redirect('/...
0
votes
1answer
22 views

How to handle http-errors in express in production?

I am developing express app and after I specify all my routes and middlewares I have this at the end of server.js: // Log errors app.use(function (err, req, res, next) { logger.error(err.stack); ...
2
votes
4answers
41 views

What's the best way to deal with an error in the server side and in the client side using nodejs + express

I'd like to know the best way to deal with errors in a response - request. I have this route that receive a request: app.get('/getInfo', function (req, res, next) { let obj = {} try { ...
0
votes
1answer
28 views

Combining async requests into a single GET API [duplicate]

I am trying to call a GET API under three different configurations for region parameter, and combine the results into a single allRegionOdds object which I want the API to return as a JSON. Here is ...
0
votes
0answers
12 views

Template engine sets my code to the wrong place. What's a mistake?

Template engine sets my code to the wrong place up to the table header. It successfully sets simple string object but it sets my table lines absolutely wrong. app.js app.get("/", function(req,res) {...
3
votes
1answer
32 views

VueJS - V-for doesn't re-render after data is updated and needs page refresh to see the change

So this code does adds or delete an entry, But whenever I add or delete, it does not show the changes or rather re-render. I need to refresh the page in order to see what changes had. note: I am ...
0
votes
0answers
22 views

What is the difference between handlebars and layouts in node using express?

I've got confused a bit recently over two terms. Handlebars and layouts. I looked it up and did not find proper answer. So, is it the same? If not, where does the difference lie? I was using ...
0
votes
0answers
15 views

OfficeGen how to set table data text size?

I am using officeGen to generate word documents. generateDocumentService.js var generateReportFromTableData = function (tableData) { console.log('tableData: ', tableData); var docx = ...
1
vote
1answer
23 views

TypeScript Integration with existing Node js express project

I Want to develop node js express application with typescript. To integrate typescript in node js I followed a few tutorials from online and it is working as expected. but .ts files converted .js and ...
0
votes
0answers
26 views

Using EJS templates with MySQL and webpack on an express solution

I am a bit confused about the relation between express, ejs templates, MySQL and webpack - and index.js and SCSS files. I am trying to build an express solution with different API endpoints for C(R)...
0
votes
0answers
11 views

Express/nginx Cannot serve static files while using named app eg: domain/myapp

I am trying to deploy two instances on our main domain. domain/myapp domain/myappdemo I am using nginx (to which I am very new). This is my nginx setup location ~* ^/myapp { add_header ...
2
votes
0answers
60 views

Insert and updating the data to database from frontend

I am new to web development. I am working in development of an angular application. I have developed an Angular form in front end, Node.js and Sql server in backend. I need some help to connect my ...