Category "express"

CSS won't load in hbs file for some reason

so I have a very basic file structure going but for whatever reason I cannot get the css to show up in the project when I run it on the localhost. everything el

node.js express req.body undefined

var express = require('express'); var app = express(); var PORT = 3000; const bodyParser = require('body-parser') app.use(bodyParser.json()) app.use(bodyPar

Getting no overload matches this call running mongoose with typescript and express

I am getting the below error for useNewUrlParser, useUnifiedTopology, useCreateIndex: No overload matches this call. Overload 1 of 3, '(uri: string, callback:

Node express with OpenID connect

I use the this library to use oidc with nodejs What I need is the following: user login with user password, or have the data already the session cookie. this is

Node/Express Cannot POST error (React frontend)

For my React/Express app, I've already built my backend API in Express, including a route for posting a blog post (/api/posts). On the front end, I built a form

413 payload too large, for base64 string after adjusting size in express

I have tried to make a post request, to my node server, with a base64 encoded file. I get a PayloadTooLargeError: request entity too large exception, so i wen

431 - (Request Header Fields Too Large)

First time posting a question please keep it in mind when reading Things i tried: Cleared my google chrome cache and cookies, tried incognito mode, updated my n

How to pass item's data to another component, edit data and save data in React.js?

I have a book table page to list all the books in the database, mapped with their book ID. If I click the book name, it will link to an edit book page, in this

Jest did not exit one second after the test run has completed using express

I'm using JEST for unit testing my express routes. While running the yarn test all my test case are getting passed, but I'm getting an error Jest did not exi

How to default to returning errors as JSON instead of HTML with express?

Express by default returns errors as HTML pages. As I'm developing a REST api, I want all my errors to be in JSON format. How can i configure express for this?

body-parser deprecated undefined extended: provide extended option

body-parser deprecated Why is bodyParser no longer required and what are the alternatives besides: app.use(express.urlencoded({ extended: true }));

Nextjs- api routes , How to remove a cookie from header?

I have two API routes which I want to set two cookies in /api/login.js and remove them in /api/logout.js. so this is my login API: import { serialize } from '

login with email or phone or username in node js

How can I login email or phone or username with password in node js and mongodb? user can login with email and password, username and password, phone and passwo

Sequelize Migrate Not Recognising Dotenv

I am able to run migrate command when I specify the database name, user and password directly. But when I provide with env variable/value. It says no database s

passport-jwt in MEAN-Stack returning Internal Server Error 500

Im using passport.js JWT strategy to authenticate my MEAN-Stack app. The unsecured routes work properly but i cant get the secured routes to work. they allways

grammar & spell checking in nodejs

How to check spelling mistakes, grammar & punctuation errors, use of greetings & short keywords and total time to complete each single chat session in s

How to use Mailgun variable in email template?

I am using Mailgun API with nodejs+express to send emails. I want to transition into using templates instead of writing the whole email as the HTML tag in nodej

createReadStream is not present in uploaded image

I am using node v14.17.0,"apollo-server-express": "^2.25.0", "graphql-upload": "^12.0.0" I am trying to upload an image but i dont get createReadStream from the

How to format and validate email node js

I would like that email had format like: [email protected]. Which is the best way to do it? I have a component for registration and I have the field like this: <mat-f

Express res.download()

I don't know why it's happening, but it's really annoying. I expected the file to be downloaded according to the express docs. I have the next code: //in rea