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.
94,396
questions
0
votes
0
answers
8
views
How can I make a nested inner join with findOne options using TypeOrm on Express?
I have the following:
const estudios = await findOne(Estudio, {
relations: {
'solicitud': true,
'area': true,
'promotor': true,
'propuesta': ...
-3
votes
0
answers
15
views
How can I alert a sql query result in AJAX and NodeJS
I want to fetch the Color1SStock column from my MYSQL server and alert it with a Javascript alert.
ChatGPT wrote the code inside of the script tag in the file Product-Display.ejs . I want the system ...
0
votes
0
answers
6
views
Could not load Connect session adapter :: connect-mongo
I keep getting this error and my Sails (v0.12) won't start. I triend everything and to be honest I do not really undertand the message itself. Can some lease give me guidence. I'm using MongoDB Atlas. ...
1
vote
1
answer
34
views
How to serve static files on nestjs?
I have a nestjs project, in the root of the site there is an uploads folder, there are files of different extensions there. How should I process them?
http://localhost:7777/uploads/audio/85/0.mp3
http:...
0
votes
0
answers
7
views
Stuck setting up cron job on vercel
I have a cron job to update a mongoDB document set up on my express server using the 'node-cron' package. It runs successfully, if i deploy to vercel and the server experiences a downtime during my ...
0
votes
0
answers
12
views
How do I get my font-end application to load a 2.61MB data set from an API
I have a front-end application that requests data from an API and displays it on a table. So far things have been working smoothly until It had to request a data set that was significantly larger than ...
0
votes
1
answer
17
views
Resolving 404 Errors for Font and Image Files in Express.js Application
I'm encountering 404 errors when trying to load font and image files in my Express.js application. I have tried various approaches, including using a tag in my HTML, but some assets are still not ...
-1
votes
0
answers
17
views
Dockerizing connecting Express to Mongo DB errno: -111 ECONNREFUSED
hope everybody is doing well. I'm working on a MEAN stack.
for deployment and setting up a cdci pipeline I'm dockerizing the frontend, the backend and the database now.
database and frontend: work. ...
0
votes
0
answers
26
views
component still visible after delete unless i refresh
iam using mern stack and i am performing crud operations but upon delete the data is still visible unless i refresh the page. I am using context to manage state and it is working fine for adding data ...
0
votes
0
answers
10
views
How to create QR code from our input images in expressjs?
I have an expressjs app. I want to create a QR code containing an image that I uploaded. Here is an example: https://codepen.io/xiongbinsh/full/goyobm According to our input image, they are creating a ...
0
votes
0
answers
14
views
how to pass the value of a variable from View to Controller in js
I have a program on the Mongo, Express, Node js stack in which I implemented the MVC template. The View folder contains two html files displaying pages in / and in /test/example. Also in the View ...
0
votes
0
answers
5
views
My Socket.io connection is connecting twice
I am making a connection between server(express, socket.io) and client(react).The connection is made but it is connecting two times.
client/src/App.js
import React from 'react';
import { io } from '...
-1
votes
0
answers
14
views
How to create a transport to connect SQL SERVER in Winston logger [closed]
I am looking for a Winston's module (JS, not TS) to help me connecting to my database SQL SERVER. I am not absolutely sure but it is possible not exist, only deprecated modules I found.
Someone knows ...
0
votes
1
answer
10
views
Separate Database for each user login in node.js Sequelize
I am developing an application where I need a separate database for each user.
So I need to change the database connection on every HTTP Request and use the database of the login user.
I'm Using node....
0
votes
1
answer
20
views
Internal server error with AWS Lambda using express js + typescript
I am creating a very basic simple rest api with Node js Express and Typescript to get lat long of an address from an actual address passed to the endpoint through query parameter.
I am deploying it to ...
0
votes
0
answers
10
views
Mixing passport username and password with some kind token strategy
I have an express app which uses a username and password to auth. It's part of a MERN stack.
I'm building a separate application and want to use some auth token to authenticate with the server.
How do ...
0
votes
0
answers
11
views
Populate Nest Field In Mongoose Express Js
**i am creating report functionality for my app. below is the post schema for the report **
import mongoose from "mongoose";
const reportSchema = new mongoose.Schema(
{
reported_post: ...
0
votes
1
answer
18
views
express - config file gets called called before app or server files which returns env variable to be undefined
in my app the server.ts is the entrypoint which serves the app in port. all app.use is done in the app.ts file where the dotenv is called. As far as I know you are only supposed to call dotenv once ...
0
votes
0
answers
22
views
ExpressJS request body suddenly modified with nested object in Node 18
I experienced this strange issue when working with ExpressJS using Node 18 deployed on GKE.
This issue happened after I upgraded the Node version to 18, prev was in 14 and all was fine.
I have a POST ...
-3
votes
0
answers
12
views
Error : [ERROR] 09:03:19 TypeError: Router.use() requires a middleware function but got a Object [closed]
TypeError: Router.use() requires a middleware function but got a Object
at Function.use (C:\Users\Amitkr\Desktop\lms\server\node_modules\express\lib\router\index.js:469:13)
at Function.<...
1
vote
0
answers
21
views
req.isAuthenticated()) always returning false value
Im trying to build a simple login and signup page , im using passport middleware on my nodejs application, and on the "/submit" route i tried to check if the user is Authenticated to be able ...
0
votes
0
answers
8
views
Cookie sent by backend disappears when page is refreshed and can't be accessed through document.cookie
I recently built my first full stack website as a pet project. The website worked fine when I was running it locally but when I deployed it, user authentication started breaking. What should happen in ...
-1
votes
0
answers
15
views
How to create DICOM server in Typescript node.js [closed]
I am developing a node.js application using typescript and I need to put a DICOM server that can query and retrieve DICOM files from radiology machines
I don’t have any idea about DICOM servers and ...
0
votes
0
answers
15
views
Safety of using JWT in Vue-Express app and its implementation
So i am making an app with Vue and Express. I wanted to use JWT to authentication.
In the login form the user writes passowrd and email- it get sent to endpoint, if the credensial are correct, the ...
0
votes
1
answer
52
views
I am getting a 404 not found axios error while sending a post request
I trying to send data by post request from react.js to express.js using axios but I am getting a 404 not found axios error.
here is the image of error q https://i.stack.imgur.com/H7ihV.png
here is my ...
0
votes
0
answers
8
views
Rewrite ExpressJS Function to AWS Lambda (Multipart-Uploader)
Does someone have an idea, how to rewrite this Express.js function to AWS Lambda for Node.js 18?
const upload = multer()
// Receive chunk and write it to S3 bucket
app.post('/upload', upload.single(&...
0
votes
0
answers
8
views
Missing headers on android webview using express lan server
I'm making a sort of home console, that serves web games on lan to multiple devices, it already works with web and unity web exports, but with godot 4 I'm having problems. Godot has some problems as ...
0
votes
0
answers
17
views
API Authentication using Node and Google OAuth2 (googleapis). Recommended way of authenticating the user?
I'm little confussed on how to handle user authorization for secured routes using the Google OAuth2 for the API authentication. I'd be glad for some guidance.
Overview:
My API acts on behalf of the ...
-1
votes
2
answers
70
views
How can I manage lengthy task functions in Node.js Express.js
How can I manage lengthy task functions in Node.js Express.js to manage lengthy task functions effectively, and prevent timeout errors? Presently, my application contains a time-consuming function, ...
0
votes
0
answers
8
views
Deploy React App to Netlify with Server file in root directory
I a created a custom server.js file to get around React's inability to generate dynamic metadata for open graph procotol) for pages other than index.html.
I'm using Create React App and followed this ...
0
votes
1
answer
37
views
Error: [Error: ENOENT: no such file or directory, open './1695556319341.mp3']
I'm trying to convert an mp4 file to an mp3 file and then directly upload it to Firebase storage without saving it locally in my machine, How can I do that currently I'm getting an error when I try to ...
0
votes
0
answers
7
views
Typescript alias path not resolving on build [closed]
I am using typescript alias paths on my express app. After build the alias path not replace it with relative path and when I run my code with:
"start": "node ./dist/src/index.js"
...
0
votes
0
answers
11
views
expo react native socketIO not connecting with the express backend running on localhost
I am trying to connect my react native app (expo) with my express backend. But when i try to connect the front end is not connecting with the backend. Here is my code:
backend:
require("dotenv&...
0
votes
0
answers
35
views
My login script is not tallying the data from MongoDb for already registered users
I have created a register and login script in nodejs to send and save my data to MongoDB when user registers he must be allowed to login with any one of the registered emails but my login does not ...
-5
votes
0
answers
25
views
Scratch node application which uses crud - want to add authorization factor in it but getting error [closed]
Application Description:
The application is a web-based platform that allows users to register, log in, and interact with a list of user profiles. It includes user authentication for security and uses ...
-1
votes
0
answers
9
views
Communication with twitter in oauth1 user context on my backend express
i create a aplication where the user connect to my app with twitter i use passport-twitter for that it use oauth1 for connect.
With that i get the token and tokensecret of the user.
I have create also ...
0
votes
0
answers
14
views
TypeError: io.emit is not a function
i have declared the io in the index.js file ( main file. and i want to emit the updates to the client inside the controllers/devices.js. but on testing it is is giving
TypeError: io.emit is not a ...
0
votes
1
answer
23
views
How can my react app can return for non-existing page status 404 for document?
everyone!
I've added my web-site to searching system, and it's retruned error like "Your non-existing pages don't return status 404". But I can't uderstand how do return this status.
I try ...
0
votes
0
answers
12
views
Deploying and Securing Node.js Express.js API for Remote Access
I have developed a Node.js Express.js web API that currently runs locally on my device. However, I would like to deploy it and enable remote access to the API so that it can receive requests from ...
0
votes
0
answers
14
views
How to send GPT response from ExpressJS to ReactJS in streaming data
I'm trying to send data of OpenAI GPT API from ExpressJS server to ReactJS, I checked multiple article like this one OpenAI Completion Stream with Node.js and Express.js but none of them worked I get ...
-4
votes
0
answers
18
views
how to solve node js warning-(node:3384) MaxListenersExceededWarning: Possible EventEmitter memory leak detected [closed]
(node:3384) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connected listeners added to [NativeConnection]. Use emitter.setMaxListeners() to increase limit
(Use node --...
-1
votes
0
answers
30
views
How to setup MongoDB id autoincrement in Nodejs using mongoose-auto-increment?
In db.js
import mongoose from "mongoose";
export function dbConnection() {
try {
mongoose.connect("mongodb://0.0.0.0:27017", {
useNewUrlParser: true,
...
0
votes
0
answers
16
views
NextJS: function exported is and imported correctly inside src/util but getting undefined
**npsUtil.js**
const { getRetirementYear } = require('./ppfUtil');
**ppfUtil.js**
const getRetirementYear = (dateOfBirth, retirementAge) => {
const birthDate = moment(dateOfBirth);
const ...
0
votes
0
answers
15
views
Cannot connect express js with firebase
const FCM = require("fcm-node")
const senderId = require('./fcm/uzhavarmann-46381-firebase-adminsdk-k7nn5-a324f0c4ce.json');
const fcm = new FCM(senderId);
Sending Notification :
app....
0
votes
0
answers
23
views
Oblect Orient Program Class Structure --- Design Problem
The question I have is a design question rather than a technical question. I am building an application in which its main feature is to allow user to select a Slack channel and a folder of images, and ...
0
votes
1
answer
25
views
ExpressJS, Stripe, Typescript, BodyParser I can not identify the type
So im doing a post on my express server. I'm using typescript
I send an undefined value from my URL in the body (Angular) to the Backend (Express Server).
Before the Object leaves the Frontend via ...
0
votes
0
answers
33
views
How to fade out flash message [closed]
I've been trying to figure out how to get the flash message to fade out once the user is logged in.
I find find any documentation that for setting a time for req.flash
app.get("/signin", ...
1
vote
1
answer
19
views
How to submit a rating and assign the new average rating to a MongoDB database using Express?
I'm currently working on a back-end project for my college degree, focusing on Node.JS, MongoDB and Express, and so far, it's been somewhat smooth. However, the assignment, which focuses on creating ...
0
votes
0
answers
24
views
experiencing an error while connecting to server
when i start my backend program, it shows following errors in the terminal
MongoServerError: bad auth : authentication failed at Connection.onMessage (C:\Users\HOME\Desktop\e 23\cinebaba\cinebaba-...
0
votes
0
answers
14
views
Sharing Zod inferred types between frontend and backend
I'm building a fullstack Express/React app. The app has a client, server and shared folder. The shared folder contains types shared between the frontend and backend like:
export interface NewUser {
...