Category "express"

SyntaxError: Unexpected end of JSON input - why is that?

This is the code I have written using express and node.js const express = require("express"); const https = require("https"); const app = express();

How to resolve a circular dependency in nest js?

I have my app.module that imports UserModule and AuthModule. @Module({ imports: [UserModule, AuthModule], controllers: [AppController], providers: [AppSer

Cannot delete image from aws s3 bucket

I want to delete one of the images stored in the AWS S3 bucket by express.js, but I am facing an issue. Below is the code I have written const imageurl=req.user

Ubuntu where to see console.logs

So I am putting my app on a server and I want to see some console logs generated from my nodejs app. Before putting it on the server I saw the output of my cons

Error: secretOrPrivateKey must have a value

I am using jwt to create token, but when i login via postman I get the error "Error: secretOrPrivateKey must have a value" from my console. I have attached my l

How to use Knex object in other file?

How do I use the knex db object inside other files? For Example my index.js const app = require("express")(); const cors = require("cors"); const bodyParser

The method FB.getLoginStatus can no longer be called from http pages

So I tried to implement Facebook Login feature in my nodejs backend server. For testing purpose, I am trying client side to check the login and get access token

How do I extend the typings of Express.Application to give typings for app.locals

In our application, we're adding quite a few config objects to app.locals that get used in our middleware. const app = Express(); app.locals = { someConfig:

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