Category "express"

Error: Failed to lookup view "layout" in views directory

I am getting the error like Error: Failed to lookup view "layout" in views directory. Below is the source code of the files as well as the folder structure. in

Next.js Authentication with JWT

I am moving a project from React to Next.js and was wondering if the same authentication process is okay. Basically, the user enters their username and password

CardElement not showing ui components in react app ie `Card Number, MM/YY, CVC?

So my problem is that I cannot see the CardElement Ui component in the image below. It should be above the Order Total: $0 which is beside the payment method.

Import sql file using express js

I am trying to import the sql file in express js. i try the following codes but it is not work while using mssql and fs module fs.readFile(__dirname +'/databa

Nodejs Express on Heroku App EACCES 0.0.0.0:80

I am trying to run a Node app on a newly created Heroku App from their web. I followed their steps and still I am getting errors when displaying app status. I

"TypeError: require(...) is not a function" in nodejs and socketio

I am creating a chat with NodeJS, Express and Socket.Io, but I have this error when I want to run the code: require('./sockets')(socketio);

How to create a middle layer for two different servers running independently in node.js

I am trying to implement a node.js layer between two servers which will help in redirecting to the respective server on a route/url change, provided both the se

Can't create a simple webhook fulfillment Good Actions Console

I am trying to do a simple google home integration with my home server. My only goal is to have it say "Hey google, turn on pool lights" and "Hey Google, turn o

Express cors get origin = 'null' with type string

Express CORS is failing for my nodejs application and I need your help fixing it. The reason is that the app is getting null with type string as origin, which i

Change sequelize timezone

I want to make restful app in nodejs Server: centos 7 64x Database: postgresql Additional: express, sequelize Table: datetime with timezone When I selecting r

how to receive a multi select in expressjs

Hello I have a multi select that looks like this input.form-control(type='text', name='names[]') I want to retrieve does values. I'm using this var names =

Best way to store DB config in Node.Js / Express app

What would be the best way to store DB config (username, password) in an open source app that runs on node.js / Express? Two specific questions: Shall I put it

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'unlink' of undefined at Grid.remove

I'm trying to delete a file by its id using gridfs but I get this error when calling the delete API. Controller : let gfs; connect.once("open", () => { gf

tsc not found in typescript express and react app when deploying to heroku

I am working on an express app(in typescript) and a react app bootstrapped with create-react-app(in js). The directory structure is here. The server directory c

Extend Express Request object using Typescript

I’m trying to add a property to express request object from a middleware using typescript. However I can’t figure out how to add extra properties to

Authentication between different applications through sessions (React + Express)?

I'm developing a React + Express website and I'm in doubt on how to implement the login functionality since it depends on another application. Let me explain it

Passing variables to the next middleware using next() in Express.js

I want to pass some variable from the first middleware to another middleware, and I tried doing this, but there was "req.somevariable is a given as 'undefined'"

Express middleware - add promise rejection handlers

I have the following simplified middleware function: router.put('/', function (req, res, next) { const data = req.body; const q = req.parsedFilterParam;

nodejs terminates on redis failure

I am using Node.js, Express, Redis and Socket.io. When Redis is down, Node.js will terminate. How can I prevent this, probably somewhere to code reconnection o

express route parameters keeps loading

I can see the dynamic id that appears on the URL but the page keeps loading... I have attached the route that HTML redirects us to and the database. // Route Pa