Questions tagged [nodejs-server]

405 questions
2
votes
1 answer

Didn't get response on browser

I write a code for to read json file and print it to browser. The code working fine it print data on console. but didn't get on browser. app.post("/uploadfile",function (req, res, next) { // Error MiddleWare for multer file upload, so if any //…
2
votes
1 answer

Error: No default engine was specified and no extension was provided. in express

i am new to backend web development and i was practicing on a project in nodejs and express.js Below is the code of my app.js file const express = require("express") const bp = require("body-parser") const app = express() app.set("view-engine",…
Nasyx Nadeem
  • 241
  • 2
  • 12
2
votes
5 answers

Callback and event emitter functionality using NodeJS

Programme language is NodeJS Steps ToDo: 1. The variable input has the input value. Extract n1 and n2 from the input. 2. Write a function to find the sum of all the multiples of n1 and n2, below and including 1000. This function should log the…
2
votes
1 answer

MongoError code 66 immutable field in nodeJS

I was trying to do an update operation. Now I'm getting an immutable error I knew the cause it was updating the key. I wonder because I'm not passing the _id from the API still I can see the _id if I console. I want to remove the _id from my object…
2
votes
1 answer

Can't export wsEndpoint created from puppeteer browser

I am trying to open a puppeteer browser upon startup and then exporting the wsEndpoint so that I may use the link to connect to the browser rather than opening a new browser every time I call the function. Here is the code snippet in the file app.js…
2
votes
1 answer

Cannot find measurement protocol in GA4 data stream to create api-secret for sending events

Initially, I had set up Universal Analytics to track some user activity on my web application but I then realized that I cannot generate reports(get data back from the dashboard for further analysis) and then decided to switch to google analytics 4…
2
votes
1 answer

Is a -dynamic- PHP app more performant than a NodeJS one?

I'm new to NodeJS, coming from mostly PHP, and am building an app that requires a fresh HTML serve from the server on each request - Node serves HTML with the EJS templating engine - no SPA framework. I've stumbled upon a case when I'm not sure if…
Danigoodw
  • 379
  • 3
  • 10
2
votes
2 answers

I tried to upload file and text data from multipart api but not able to get files even i use multer

I tried to upload file as well as text data from the api,so i have write multipart api for getting file and text data from the res in nodejs for getting file i am using multer module but now i am getting undefined or null in req.files & req.file.…
2
votes
0 answers

RSA_padding_check_PKCS1_type_2:pkcs decoding error

I need to decrypt a message with the following logic Logic RSA/ECB/PKCS1Decryption(Base64Decode(encryptedKey),B2C.cer) Tried with two modules crypto & node-RSA returns a similar error. RSA_padding_check_PKCS1_type_2:pkcs decoding error Code const…
2
votes
0 answers

Nodejs: Override global.eval

Is there any way to safely override eval? Have tried directly overriding: var oldEval = global.eval; global.eval = function(){ // my logic global.a+=1; return oldEval.apply(this, arguments); } This somehow gives the following reference…
Anupam Juniwal
  • 309
  • 1
  • 3
  • 11
2
votes
1 answer

Nodejs cluster forking not working on Windows; how do you enable the round-robin scheduling?

Similar questions have been asked, as to why a nodejs cluster forking only delegates to one worker on a windows machine. We know the answer is that the RR algorithm is disabled on windows, but so then, how can you enable it? I have a hint: 1)…
Ruben Martinez
  • 543
  • 4
  • 12
2
votes
1 answer

How to get status code in jwt token based error msg using nodejs?

I implemented JWT token authentication using node.js and MongoDB. It's working fine. Throwing error messages is also working fine (token invalid, JWT expired, JWT must be provided). But how do I get the appropriate HTTP status code in the error…
smith hari
  • 437
  • 1
  • 11
  • 22
2
votes
1 answer

How to extract data using async and await function in node js?

I tried redis cache implement in node js using mongodb.I set the data in cache.but i cant get the data in cache.how to solve this issue. cache.js async function Get_Value(){ let response = await client.get('products') …
smith hari
  • 437
  • 1
  • 11
  • 22
2
votes
0 answers

If database data is changed its automatically changing in redis cache?

I implement redis cache in node js using mongodb its working fine.but I have doubt In mongodb I have 10 records.I tried to exceute my node js code its get data from db and stored cache its working fine.suppose I deleted data from db but its not…
smith hari
  • 437
  • 1
  • 11
  • 22
2
votes
2 answers

How to implement jwt verify token in node js

I tried to implement jwt token generation in node js.I got jwt token but how to validate token using node js crud operation.but I got token jwt verfiy code using callback function.without call back function used to implement async/awit function…
smith hari
  • 437
  • 1
  • 11
  • 22
1 2
3
26 27