Questions tagged [express]
Express.js is a minimal and flexible Node.js web application framework providing a robust set of features for building web applications.
express
95,751
questions
0
votes
0
answers
4
views
Uploading session data from Express js server to Redis
I am trying to upload the session data to redis whenever a user logs in onto my react native app. Im getting this error "Argument of type 'unknown' is not assignable to parameter of type '...
0
votes
0
answers
10
views
Error while running node express server in docker
node:internal/modules/cjs/loader:1148 throw err; ^ Error: Cannot find module '/app/index.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15) at Module._load (node:internal/...
-1
votes
0
answers
13
views
Express js and prisma async code will not push to array
I have code here where it won't push to an array but will log that the user does exist or does not exist. If I log the list when its called then it shows something in the list but if I do the opposite ...
0
votes
0
answers
7
views
Not able to add the data in database :postman error:Cannot GET /api/v1/createTodo
const express = require("express");
const app = express();
//load config from env file
require("dotenv").config();
const PORT = process.env.PORT || 4000;
//middleware to parse ...
0
votes
1
answer
15
views
The factory._id cant be added inside the user table using node.js and MongoDB
I'm building a flutter app where I can add the phone number that I want to invite in my database. With adding the phone number inside the database, it will also add the factories ID that it assign to. ...
0
votes
0
answers
13
views
app.get("/:id",(req,res)=>{}) working every calling of endpoint which has in app route
I am facing a problem. I have create a end point that in app route. There is a endpoint
app.get("/:id",(req,res)=>{
console.log(req.params)
})
There also some endpoint like localhost:...
-1
votes
0
answers
15
views
Alternative for send onQuerystarted as the logout function is not working as intended
I am currently building a MERN application , for the same I have made a logout in my api endpoint which is working as intended and has been tested in postman , However when I try to logout from my ...
-1
votes
0
answers
27
views
How come I can't get my GET requests to work but I POSTS works fine?
I am working on my first webapp.
I can sign up a user or log in a user and the user is stored in my database and a authentication token is generated when they log in.
I can successfully have the user ...
0
votes
0
answers
15
views
Best/Simplest Way to Incorporate User Routing or a Front-End Framework into an Existing Project [closed]
I am making a card game with Node.js, express, and socket.io. The game is written in 4 files with a server.js, index.html, index.js and style.css and works for what it is (the index.js handles the ...
0
votes
1
answer
38
views
Postman show up infinite "Sending request..." on my nodeJS MongoDB application
this is my entire code of my chatbot application
const express = require('express');
const app = express();
const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');
const ...
0
votes
1
answer
33
views
InnerHtml is not display on Screen
`
I am working on a web project using HTML and Bootstrap, but my content is not displaying in the browser.Here is my code:
`
let str = ""
for (let item of r.articles) {
str = ...
-1
votes
0
answers
45
views
API not working when serving static file from express server
I am working on my chat application project which is working fine in development.But when I am serving static file from server chat API is not working which fetch the chat list.It’s responding with a ...
-1
votes
1
answer
28
views
When requested URL Parameter is '1', it shows undefined when logged
I was writing an API code where the objective was to take in an input URL as a form URL encoded, body parse it, validate it, make a short URL, and when the client requests the short URL, it redirects ...
0
votes
0
answers
29
views
Express return error if body greater than 1mb
Hello guys I'm trying to create a middleware in express
function logResponseBody(req, res, next) {
var oldWrite = res.write,
oldEnd = res.end;
const maxSize = 1023;
var chunks = [];
...
0
votes
0
answers
17
views
How to set up an Express server with Socket.IO on Netlify or another free host?
I'm trying to set up an Express server with Socket.IO and deploy it on Netlify. My server was working fine on localhost, but I'm having trouble configuring it to work on Netlify. Here's what I have so ...
-1
votes
0
answers
10
views
How to build multi-tenant application in MERN stack with templates , plugins and custom domain feature [closed]
I want to build a multi-tenant application in the MERN stack with features like templates, plugins, and custom domains. The platform will be similar to MyDukaan for landing pages. Here are the key ...
0
votes
0
answers
33
views
Unable to access authorisation cookie
I am trying to implement backend(express+node +supabase) authentication for my frontend(react)
/*BACKEND*/
//auth.js
import { supabase } from "../config/supabaseConfig.js";
export const ...
0
votes
0
answers
44
views
Clearing back/forward cache only after logout
After a user has logged in or out, and the browser back button is used, the page is restored from the bfcache,
The page is restored even when a logged out user isn't supposed to access this page.
I ...
0
votes
0
answers
24
views
Invalid csrf token at doubleCsrf
Need help, can't figure out why Set-Cookie is not being passed to the subsequent requests. If I'm able to do so I think the authentication will work.
Error message:
ForbiddenError: invalid csrf token
...
0
votes
0
answers
22
views
multer out side the the middlware
i have problem in how can i use multer in a method not in route or middlware
because i dont have access to req and res!!!
import multer from "multer"; import path from "path"; ...
0
votes
1
answer
23
views
request body is empty in backend while using fetch on express
I have a nodejs application where I have two scripts, server.js and script.js. The relevent code in both blocks are as follows:
script.js
const topic = document.getElementById("topic")....
0
votes
1
answer
26
views
React, Node.js, jwt Login process. I can't stay the state with accessToken
I'm using accessToken and refreshToken to login process. I made up my mind to store accessToken in React useState and refreshToken in Cookie by using httpOnly. accessToken is saved in state. ...
-1
votes
0
answers
25
views
Have trouble with Express js [closed]
i am using Express js application with node version 20.14 lts. I used npm start functions to deploy the application. But my problem is my crash after few hours of deployment. Its works fine 4-5 hours. ...
-4
votes
0
answers
16
views
Assing specific routes to specific cluster workers? [closed]
NodeJS Express - Send specific routes to specific cluster workers?
i have three workers when assinged three different routes in three workers its some times executes sometime cannot get showed why in ...
0
votes
0
answers
21
views
Cookies are not being set in Nextjs 14 from Express Api Deployed on Vercel
Recently i have deployed both node/express api and client(Nextjs 14.1.0) to vercel everything works fine except cookies. In some cases i am getting cookies but they are just temporary when i refresh ...
0
votes
0
answers
11
views
How to Configure Google Auth Redirect URI for a Node.js Application on AWS EC2?
I'm currently deploying a Node.js application that uses Google OAuth 2.0 for authentication on an AWS EC2 instance. However, when users attempt to log in using Google, they receive an "access ...
-1
votes
0
answers
19
views
what kind of standard node/express app would u create to prep for a related interview? [closed]
I'm primarily a React developer. I have decades of full stack experience, but I've only used node/express for side projects. Ie I've never used it on a corporate/enterprise project - and I've never ...
0
votes
0
answers
49
views
Why is my AJAX request not working in Node.js and Express project?
I'm trying to make a request using ajax to my backend, but it always returns a 404 error, but my route exists.
Project structure:
public
-scripts
--script.js
routes
-chats.js
views
-chats.ejs
index.js
...
0
votes
0
answers
15
views
express http-proxy-middleware upload not working
When i am uploading file from frontend with formdata as body of post request, Backend is returning 400 bad request.
const formData = new FormData();
formData.append("file", this....
1
vote
3
answers
38
views
How to limit bucket upload size in Backblaze B2 (S3 COMPATIBLE API)?
I'm implementing a functionality in our app where users buy a subscription and create their workspace. Each subscription plan has different storage limits (e.g, 5 GB for a small plan). We use ...
0
votes
0
answers
39
views
How to query two Sequelize models through a junction table? Sequelize throwing error on 'through: model'
I am writing a webapp for practice. I have several sequelize models, and querying the db through them so far has been no issue. However, when I tried to use a junction table to return what would be a ...
2
votes
2
answers
1k
views
Whatsapp-web.js package failing when scanning the QR code
client = new Client({
authStrategy: new LocalAuth({
clientId: phoneNo,
dataPath: sessionsPath,
}),
webVersionCache: {
...
-1
votes
1
answer
32
views
How should I to install of OpenCV in express.js? [closed]
I tried to install "opencv4nodejs" in my project but it was giving me a lot of error in setting so if anyone can help me it will be better for me. since in my project I am trying to check ...
0
votes
0
answers
54
views
Swish API Payout Request: Error 'PA01: Parameter is not correct'
I'm trying to integrate the Swish API for a payout request using Node.js and Express. Despite following the documentation closely, I keep encountering the error with 401 unauthorized error:
{
"...
0
votes
0
answers
24
views
Numeric Cells Displaying as $NAN [closed]
I am currently working with dollar-heavy data and am utilizing the following script to format the data with commas (in express and hbs):
<script>
$(document).ready(function () {
$(&...
0
votes
1
answer
31
views
Why can't we use or export the express() instance in other modules / files instead of using Router() instance while segregating routes in Express
I've tried to created routes in other files by exporting the express app instance
const app = express() and
export default app, but I'm getting the 404 route not found error when I import app instance ...
0
votes
0
answers
8
views
Migrate Express Backend and React Native Frontend to Monorepo for TRPC
I have a node.js Express (Typescript) backend. I also have a React Native frontend. These exist in separate repos.
I want to use TRPC: https://trpc.io/ to achieve end to end type safety. To my ...
-3
votes
0
answers
24
views
Here is a simple example of a dofollow link in HTML: [closed]
~!Assistir Filme Meu Malvado Favorito 4 2024 Online Dublado e Legendado Completo em Português HD
In this code:
href="https://consumer.huawei.com/en/community/details/topicId_210577/" ...
-1
votes
0
answers
26
views
How can I Properly Use express-async-handler with TypeScript in an Express Application?
I'm working on an Express application using TypeScript and I'm trying to use the express-async-handler package yet I can´t seem to make TypeScript happy...
import { Request, Response } from "...
-1
votes
2
answers
66
views
React MySQL Insert query successful but not inserting into dB table
Working on a React/MySQL registration page. Insert query run, but is not inserting into the dB table. Not sure why.
In the backend folder, I have my server.js file:
const express = require("...
0
votes
0
answers
20
views
Typescript not recognizing type files when trying to extend Express' `Request` object to incl.ude custom properties for middleware functions
I am currently working on a typescript project that uses express to manage backend API calls, however when trying to assign these custom properties, typescript raises an error stating that these ...
0
votes
1
answer
25
views
Puppeteer Scraper Not Accessing Connected Clients in Node.js Server
I am developing a web application using Node.js, Express, Puppeteer, and MongoDB. My goal is to create a scraper that sends real-time updates to connected clients via Server-Sent Events (SSE). However,...
0
votes
1
answer
33
views
Reactjs cient not receiving cookies from express server
I'm running my project on different servers, backend on render and frontend on vercel. However I'm only running into this error on deployment, meaning that the cookie is either not being set properly ...
0
votes
1
answer
37
views
Getting Note.count is not a function
I want to count the number of documents from the database. But getting Note.count is not a function error.
Here's my code
const Note = require("../models/Notes.js");
const mongoose = require(...
0
votes
0
answers
12
views
Response cookies are deleted on every page reload (Node + Astro)
UPDATED: I was able to solve my problem by reading the cookie from req.headers.cookie instead of req.cookies. I followed the instructions from firebase docs and other resources but It wasn't work. ...
-2
votes
0
answers
43
views
http://localhost:5000/api/user getting this problem again and again how to resolve this [closed]
The data is storing in MongoDB but I'm not able to fetch it in local host of backend. I'm keep getting this:
Cannot GET /api/auth/register Error in http://localhost:5000/api/auth/register
// ...
0
votes
0
answers
11
views
Run an express server on a domain from cyberpanel
I am using Cyberpanel with Ubuntu 22.04. I have created a website srv.example.com and inside its public_html I have installed an express server and the app.js file is the below:
const express = ...
0
votes
1
answer
18
views
File upload using multer and transfer to a dedicated folder on Nodejs express application
configure the multer
multer configure as global middleware
helper for re-use to get uploaded image or images path
transfer upload file to a dedicated folder
To upload single file and transfer to ...
-1
votes
0
answers
19
views
FormData instance is empty in a script used for uploading a file to express server
I am trying to upload a form (which includes a file) to a server. I've used FormData to create an instance of the form data and set it in the body of the POST request. However the formData is not ...
0
votes
0
answers
23
views
route with query string not working in express
I am not being able to retrieve the query strings that I sent through a specific route on a node server using req.query (url?var=value)
It seems that it never enters the route
if I modify the routes ...