Category "express"

How can I generate image with Nodejs

I've made dynamic image generate service like this https://dummyimage.com/ by PHP. now I'm thinking of make a dynamic image generator with nodejs. but it's not

How to auto-refresh the browser on .ejs changes when using express + webpack middlewares?

I have set up a server using express and the webpack-dev-middleware and webpack-hot-middleware that is currently accepting module replacements for the .js files

How to store and update variable in ejs, access it on different routes

I am absolute beginner concerning javascript, express, node, ejs, etc, please go easy on me. :D I am creating a website, which is a gallery of my projects. You

Invalid "id" when trying to set up Google OAuth2 with Passport

I'm trying to set up my user authentication routes with passport using the GoogleStrategy and having some issues configuring it. I grabbed some code snippets to

Property `user` does not exist on type `Session & Partial<SessionData>`

I had a code in javascript and I'm trying to convert it to typescript route.get('/order', async(req,res) => { var sessionData = req.session; if(typ

Using a Raspberry Pi 4 to host react web app [closed]

I have some broad questions on the flow of how to set up my web app on Raspberry Pi. I've built a React App on my local PC, it hits up an node

Mailchimp works on localhost, but github pages sends error 404. Noobie

Checked docs, looked at other codepen examples, but cannot figure out. Any help would be greatly appreciated my github page index.html <html lang="en"> &

TypeORM bulk insert?

How do i bulk insert multiple records in 1 query so my db will be efficient I want to create Office and insert multiple new equipments into that office. Table/m

Ambiguos "Error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type" error in nexus graphql

I'm getting the following error when using nexus to define a graphql schema with apollo-server. Error: NEXUS__UNKNOWN__TYPE was already defined and imported as

TypeError: authJwt is not a function

I am doing an e-shop project using MERN stack in that I faced the above error app.js: const express = require("express"); const app = express(); const morgan

Express not catching exception in middleware

I'm attempting to use middleware to catch exceptions in routes. Expected Result: When an error is thrown in a route I expect it to be caught by the middleware

Docker Redis Error: connect ECONNREFUSED 127.0.0.1:6379

I'm following a tutorial from youtube creating a simple dockerized CRUD application in Express, Node.js, Mongo & Redis. I stucked at video 3:06:57 on Authen

why sequelize beforeUpdate hook doesn't work?

I have a simple user model with 2 hooks. User.beforeCreate(setSaltAndPass) User.beforeUpdate(setSaltAndPass) the first works perfectly but the beforeUpdate doe

Ask for credentials before showing my swagger

I'm trying to add security to my API swagger endpont. I have created my API using node.js and express and swagger-ui-express module. The problem is that anyone

Session Data is not updating

I m using express-session and memcached-connect package for maintaining session. Everything is working as expected. Here is my implementation: Middleware app

create-react-app shows an error of "You need to enable JavaScript to run this app."

I use express for my API. I have a folder named app and another folder named server. app is the client app, using create-react-app as boilerplate, while server

How does this function that takes in a RequestHandler in express work?

I was browsing through some code examples for Express server on GitHub and came across this function used to wrap around REST API controllers and was confused h

How to return id of uploaded file (upload with multer in nodejs express app)

I have an MEAN stack app and trying to upload file with multer. Upload is working fine the only problem is I want to return uploaded file's id. //multer setti

How to generate a refresh token?

I am implementing JWT in one of my node apps. I am wondering, if there is any definite format/ structure in which a refresh token should be generated? By de

Creating single instance or multiple instance of service layer in nodejs

I want to know what should I use to expose my service layer for nodejs api What are the pros and cons of using the approach 1 and 2. app.post("/", (req, res) =&