Questions tagged [nodejs-server]

405 questions
0
votes
1 answer

Unexpected token , in JSON at position 10855 , NodeJS

I am fetching data from movieDB API in nodeJS using http.request method. While it works most of times, I am getting error if I reload the page(make API call) more than 10 or 15 times . Following is my code here - router.get("/", (req, res, next) =>…
Baba
  • 11
  • 3
0
votes
0 answers

Node JS: how can i convert buffer data to JPEG and store it

I want to convert an image from img.src to jpeg format if it doesn't support any of the given formats. but here toBuffer(err,buffer) return buffer as null. What should i do. import { JSDOM } from "jsdom"; import mammoth from "mammoth"; import gm…
0
votes
1 answer

AWS SNS Subscription confirmation with node route

I want the body to go forward, from AWS SNS subscription confirmation is sending POST request to my route of nodejs API but the body is coming empty or undefined this is a curl request from AWS curl -X 'POST'…
0
votes
0 answers

TypeORM: How to get the one to one relationship on a query that has multiple relationships

I have the following query const user = await userRepository .createQueryBuilder('user') .leftJoin('user.roles', 'role') .leftJoin('user.storage', 'storage') .leftJoin('user.transferHistory', 'transferHistory') …
Padua
  • 57
  • 2
  • 12
0
votes
1 answer

'req.headers is not a function' while trying to pass headers from client to nodejs server

I have a frontend that makes a call to my proxy server, which then makes a call to an Application API. I am trying to pass my header from the UI to the backend, but I am getting a TypeError: req.headers is not a function Here's what I am doing. What…
Tini
  • 169
  • 8
0
votes
0 answers

ftp-srv - size limit for each user

i am running a ftp server with ftp-srv and i need to limit the space for each user , the ftp-srv package don't have a feature to do this, however i find a answer to same issue on github , but its so general and confusing , i was hopping that someone…
4lireza
  • 3
  • 2
0
votes
0 answers

How to connect node js server to a chrome extension?

I am trying to create a chrome extension which will use nodejs as server. But chrome extensions don't allow me to use the require keyword. I tried implementing websockets using socket-io in service worker script of extensions
0
votes
0 answers

getting an error on pushing the object inside the array in mongoose TypeError: Cannot read properties of undefined (reading 'push')

I was trying to push comment in the post schema my Post schema looks like this const postSchema = new mongoose.Schema({ content:{ type: String, required: true, }, user:{ type:mongoose.Schema.Types.ObjectId, …
0
votes
1 answer

I want to get from which domain the request comes with its parameter in node js or express js

I only get the from which domain the request comes but I want to get the domain name with query parameters. For example the main domain name with query parameters htpps://abc.com?userId=1&campaiginId=2 From above domain I request to…
Md Saif Uddin
  • 179
  • 2
  • 8
0
votes
1 answer

Why is Net.socket receiving wrong data when receiving fragmanted websocket frames?

I have following code that establishes connections and listens for data from a websocket client Server (nodejs) const server = net.createServer((c) => { console.log('client connected'); c.on('data',(data) => { let parsedData =…
godmodule
  • 1
  • 3
0
votes
0 answers

Connection of server side and client side not emiting a listener response

// Client.js file const socket = io('http://localhost:8000'); const form = document.getElementById("send-con"); const msginput = document.getElementById("msginp"); const msgcontainer = document.querySelector(".container"); const username =…
0
votes
1 answer

How to upload a file to aws ec2 amazon linux 2 with POST request from any user local machine

I created a Nodejs server, that accepts files from user, and im stroing those file to a cms, so that i can generate the file link, and after the file link has been created, i wrote a fucntion, that deletes the file by using the file directory and…
0
votes
0 answers

How can I check what node js version is supported by any specific package or library?

I am using elastic-search-mock in my backend for unit test cases but somehow it is giving error. ERROR Class MockConnection extends Base Connection Typeerror: class extends value undefined is not the constructor or null" And I wanted to check if…
Aakash
  • 1
  • 2
0
votes
1 answer

server Started on Port: undefined in undefinedmode

const app=require('./app') const dotenv =require('dotenv'); const PORT=3000; dotenv.config({path:'backend/config/config.env'}) app.listen(process.env.PORT,()=>{ console.log(`server Started on Port: ${process.env.PORT} in…
0
votes
3 answers

Nodejs unable to connect with MongoDB

I am creating a basic application to connect my Nodejs code to MongoDB but the code is not getting executed. Have attached image for the output I am getting. It is not printing to console got db connection Have checked that the MongoDB is up and…