95,726 questions
0
votes
0
answers
30
views
Failed to execute 'json' on 'Response': Unexpected end of JSON input
(Why is 'Hello' always cut away from the text rendition? Anyways... Hello!)
I'm struggling to find the cause of a
'Failed to execute 'json' on 'Response': Unexpected end of JSON input'
error I'm ...
-1
votes
0
answers
8
views
Meta API 400 Error on Last Call While Payload Works in Postman
`Title: createAds API 400 Error on Final Call in Loop, Works Fine in Postman
Body:
Hello,
I'm encountering an issue when making the final API call in a loop to create ads using the Meta API. The final ...
-6
votes
0
answers
21
views
Currently my project is not working due to this issue, how to fix this [closed]
Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple ...
-1
votes
0
answers
17
views
Node/Express application deployed on Render blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource
I've been debugging this for several days, trying different deployment variations. My simple test full-stack app behaves as follows:
it works fine when the backend server runs locally + frontend runs ...
-4
votes
2
answers
35
views
Should I refetch data after DELETE operation in MERN stack to maintain data consistency? [closed]
I'm building a Todo application using the MERN stack (MongoDB, Express.js, React, Node.js), and I have a question about best practices for maintaining data consistency between frontend and backend ...
-2
votes
0
answers
22
views
CSRF token problem in login post request in React.js and Express.js
my server.js code:
const express = require("express");
const https = require("https");
const fs = require("fs");
const sql = require("mssql");
const bcrypt = ...
0
votes
0
answers
18
views
Can I perform DELETE queries in a controller that works in a PUT request endpoint? [closed]
I might've not explained well the question above since I am pretty much a rookie working with Express js.
I have the following Route in my "barbershopRoutes.js" file:
barbershopRoutes.put(&...
-1
votes
0
answers
14
views
How to write cookies via websocket in Express?
I'm trying to figure out how to write cookies via sockets in a shared session setup, but I'm unable to figure it out. I can edit the session and all, but that's it. I'm showing the setup I've made to ...
-2
votes
0
answers
14
views
aggregating files among microservices [closed]
I would like to make my own gateway written in typescript,express to receive from data from client and route all data to the internal microservice.
note that the form includes media files (audio, ...
0
votes
0
answers
17
views
Problem uploading image from express to s3
I want to upload an image to s3 but cant, eventhough a similar api like that can work normally.
exports.createPost = async (req, res) => {
const { user_id, title, caption } = req.body;// ...
-4
votes
0
answers
32
views
Manage SSL connections correctly for a NodeJS server running behind a no-ip dyndns domain [closed]
I've been setting up and running a NodeJS web application (ByteStash) on a Raspberry Pi 4 system without any issues.
It listens on port 5000 but it currently doesn't provide an HTTPS server. So using ...
0
votes
1
answer
20
views
Receive Postbacks through NSAdvertisingAttributionReportEndpoint with Node
I try to get the body of a postback with Node in Firebase Functions:
const app = require("express")();
app.post("/.well-known/skadnetwork/report-attribution/", function(req, res) {...
0
votes
0
answers
17
views
Express, HTTPS WebSockets, and IISNode
I have a very basic Express server that also has an HTTPS WebSocket server running on the same port. When I run this locally I'm able to hit the express endpoints and establish a connection between ...
0
votes
0
answers
28
views
GET http://localhost:5000/api/v1/auth/authCheck 401 (Unauthorized)
I’m trying to make a GET request to http://localhost:5000/api/v1/auth/authCheck from my React frontend, but I keep getting a 401 Unauthorized error.
The backend is written in Node.js with Express, and ...
0
votes
0
answers
10
views
Deploy Nodejs Application over AWS Elastic Beanstalk but can not run backend api although deployement is successfully
enter image description here
app.j
const express = require("express");
const dotenv = require("dotenv");
const http = require("http");
const cors = require("cors&...
0
votes
0
answers
16
views
Socket IO - Websocket connection failed
I am using socket io for my project and I am getting error websocket connection failed.
I am using Express JS as backend and NEXT JS for frontend Below are the code for connections -
Express Server -
...
1
vote
0
answers
20
views
express-http-proxy resets connection when transfter-enconding header is set to chunked
I have a very basic usecase where I'm proxy requests to example.com to def.com using express-http-proxy module. Code is straightforward as shown in the documentation.
var proxy = require('express-http-...
0
votes
0
answers
21
views
How to log a hostname of requests to firebase hosted API, when custom domain is used and Express
I have API build as Firebase cloud function, running express webserver and the function is connected to custom domain. I want to log the url clients are using to initiate request to the API.
Reading ...
0
votes
1
answer
24
views
Can I have two Stripe webhook endpoints listening for the same event?
I am running into an issue since I have two webhook endpoints (/webhook/stripe and /webhook/stripe-connect) on the same server, and both listening for payment_intent.succeeded for different purposes.
...
-1
votes
0
answers
23
views
Is there any public API to get mock data of user defined json structure? [closed]
I was working on some of my very first projects(React, express). After spending sometime on these projects, I realised the issue of getting mock data. I used to give a JSON structure to AI, and then I ...
-1
votes
0
answers
54
views
POST request successful, GET request giving 200 code but empty array
I am a beginner and practising writing some API routes to a MySQL database. My database is being updated successfully using both the form on my application and in Postman. When I use the MySQL ...
0
votes
0
answers
32
views
One POST route worked, but another failed on remote server
In my express.js backend (connected to flutter frontend), I have two routes: POST /auth/registrasi and POST /auth/login.
If I run the backend on my localhost, both routes worked (I have tested it ...
-3
votes
0
answers
44
views
CORS options reponse being HTML [closed]
I am trying to make an API call to this server, it is working using thunderClient, but when I make the call using my front-end, I get this error:
Test.jsx:15 Error: SyntaxError: Unexpected token '<...
-1
votes
1
answer
51
views
How do i properly hide supabase secret key in the backend? [closed]
I found little to no information about this and I don't know where to ask. How do I initiate a BaaS (Backend as a Service) client? For example, I've been using Supabase, and I've already implemented ...
1
vote
1
answer
23
views
javascript express body has no contents
My problem is that req.body is returning 'Object'. In the code below I get the TypeError message. The 'req' variable seems to contain nothing.
First, this is my curl testing command. I would like '...
-2
votes
1
answer
30
views
Why Api of New account on OpenAI not Working?
I created new account on Open AI and it shows free $5 limit and using it for testing but it is respponding with 429 status error do I have to pay first to test or is it error from my code?
import ...
-1
votes
0
answers
17
views
How to Handle Access Token Expiry and Refresh Token in MERN Stack with Next.js and RTK Query?
I am working on an e-commerce project using the MERN stack and implementing JWT-based authentication. Here's the tech stack:
Frontend: Next.js (App Router) with RTK Query for state management.
Backend:...
0
votes
0
answers
21
views
Configuration of Keycloak and Passport on a Nestjs Project
CONTEXT: we have a project based on Docker Containers, front and back are done with their dockerfile, that are called in the compose.yaml (we have 3 dir, front, back and infrastructure (where compose....
1
vote
0
answers
24
views
Express middleware for DTO validation throws undefined TypeError on valid payload
I have a POST /login route in my Express application where I'm using a payload validation middleware before the controller, structured as follows:
profileRouter.post(
"/login",
...
0
votes
1
answer
21
views
Where are express-session cookies stored?
I am using express-session to store data pertaining to user sessions, such as sign-in state and access_tokens. I'm also using connect-session-sequelize to create a store for the session, so cookie-...
0
votes
0
answers
54
views
Values are returning null objects despite existing in mysql db
I am perplexed as to why my values are returning as object types instead of number/int types even though they are defined as such, in addition, there are values existing in the table but upon ...
1
vote
0
answers
38
views
Receive chunked response from server in frontend
I have a node.js/Express Backend API which returns its response with response.write(chunks) within a loop.
res.setHeader('Content-Type', 'text/plain; charset=utf-8');
res.setHeader('Transfer-Encoding',...
0
votes
0
answers
42
views
Struggling to Configure Nginx Reverse Proxy for HTTPS (Port 443)
I've been struggling with this issue for almost two weeks now and need some help. I'm hosting a simple app on my server to test it online. To set it up properly, I decided to use Nginx as a reverse ...
0
votes
1
answer
22
views
Convert a ytdl-core stream into a blob in Nodejs express
I'm working on a YouTube playlist audio downloader and have run into a snag (see below). I have no problem downloading the audio for one video; I simply pipe the stream to the response:
ytdl(info....
-2
votes
0
answers
37
views
I am getting 404 error while creating dynamic routes in NodeJs / Express.js server
i am creating a dynamic route file for calling all routes declared in routes folder in node js.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8&...
0
votes
0
answers
17
views
discord oauth2 login session persistence lost on mobile after redirect
I'm working on a Discord login integration for my app, and it's mostly working, but I'm running into an issue with authentication persistence.
The login works fine on desktop — I'm redirected to ...
0
votes
1
answer
61
views
How do I make my JavaScript know the index number of the post I want to delete?
This is the second question I'm asking about this capstone project!
For the project, I need to make it possible to delete and edit posts. I'm focusing on the delete part now, but I don't know where to ...
0
votes
0
answers
27
views
Why is my GET route for searching players by name in Express.js not working?
I am building an API using Node.js and Express.js to manage football players. I want to implement a GET route that allows users to search for a player by their name using a query parameter. However, ...
0
votes
0
answers
6
views
express-validator in node multipart/form-data
I tried sending in postman a form-data with 2 fields, userProData with the Json data of the user, and imageProfile as a file.
I cant find how to send in a single request both body json with user data ...
-1
votes
0
answers
10
views
Getting error from newsapi in express.js, while fetching data
const express = require("express");
const axios = require("axios");
require("dotenv").config();
var cors = require("cors");
const app = express();
app.use(...
1
vote
2
answers
42
views
Set the view directory and layout in ejs based on the path of the request
I have a little dilemma, where I am trying to make a website with a function for changing the views directory and the layout of a node.js server:
app.use((req, res, next) => {
const segments = ...
0
votes
1
answer
32
views
So does Passport req.login() persist User in Session?
Though I've been working with node express for over two years now, passport/saml authentication is brand new to me. I've noticed that documentation about this is very thin, incomplete and sometimes ...
0
votes
1
answer
39
views
Localhost didn't send any data in my Node/Express/Axios app
I'm working on a full-stack Node app using Express, with Axios to make a call to an external API. My API call is working, but it doesn't seem to send any data back to my route handler and I'm getting ...
0
votes
0
answers
25
views
How to deploy a react-redux-vite app that has Express backend to Netlify
I am working on an app that is built with React, Redux, Vite in the frontend and Express in the backend. The frontend makes requests to the backend for fetching an access token, user-details and data ...
0
votes
1
answer
45
views
"TypeError: Cannot read properties of undefined (reading 'puttit')"
so. i'm doing a web course's capstone project. for some reason whenever i submit my form it throws this at me (all ive edited is changing where it says my real actual name to 'siffrin', for privacy.)
...
0
votes
0
answers
22
views
How to refactor my index.js page so that my db connection isn't called when running tests
I'm building an API and used a tutorial as a basis, but it didn't cover testing, so I'm looking too add testing as I'm going. But when I import my app object into the test it's running all the code (...
0
votes
0
answers
22
views
How to store session data in express properly
I have a 4.x express app. I would like to store data in the session after user has successfully logged in. When I try to access this data in another request the data is always undefined.
Here is my ...
0
votes
0
answers
17
views
OAuth integration issue with Nextjs
on the server, here's the setup im using :
const router = require("express").Router();
const {
register,
login,
googleLoginRedirect,
refreshToken,
resetPassword,
setNewPassword,
...
1
vote
1
answer
48
views
Using Aggregates on Multiple related tables removes rows without relation
I have a postgresql database I am trying to query and this is my current code:
SELECT r.id, r.band_id, r.title, r.imageURL, v.rating, b.name AS bandname, l.price
FROM records r
...
1
vote
1
answer
21
views
saveUninitialized and resave in session (node js)
When to use saveUninitialized and resave in express-session ?
I'm newbie for Mern stack and am trying to implement session management. where I came across "express-session", I found a common ...