Questions tagged [nodejs-server]
405 questions
1
vote
2 answers
How to make nodejs server act like a proxy and get img from cloudinary then send it to browser
for storage space issues i cannot save images in server so i had to store it in cloudinary
and for seo purposes I had to serve it from my domain not cloudinary's
so i thought to get img files from cloudinary and send it directly to browser (to be…

Andrew Naem
- 162
- 12
1
vote
1 answer
How do I stop my nodejs server for test purposes?
my nodejs module starts a server on a specific port, I am wondering if it is a way to stop the execution of that server in my mocha test:
Let's assume that myserver.js contains something like:
myserver = http.Server(app);
....
process.on('SIGTERM',…

user1971444
- 57
- 1
- 9
1
vote
0 answers
NodeJS with Bull: Cant run job / queue twice, getting : Error: Cannot define the same handler twice __default__
I created a job that allows me to create a pdf file with dynamic content inside. It works when I do a post request the first time and start the job, but the second time it fails with the errror above.
what I basically have in the invoiceWorker.ts…

codingIsLove
- 101
- 1
- 8
1
vote
0 answers
Heroku Internal Server Error (500) - Node.js
I've created a backend with Node.js and I've gone through Heroku's Node.js troubleshooting guide with no luck.
This is what I get when I try to hit /items:
2021-12-22T00:00:31.281188+00:00 heroku[router]: at=info method=GET path="/items"…

Virginia Wilcox
- 11
- 2
1
vote
1 answer
Heroku Node/React Deployment Routes Everything to index.html
I have an app.js node main file where I define my api path as the following
app.get('/api/users', UserController.get);
Below in the same file I have the following
app.use(express.static(path.resolve(__dirname, "./front/build")));
app.get("*",…

levi
- 3,451
- 6
- 50
- 86
1
vote
0 answers
How to implement Session authentication using node js and PostgreSQL
First Time I implementing Session Authentication using Node JS and PostgreSQL. In this implementation I facing an issue in backend side i have a /login endpoint. In this endpoint user login successfully It will generated session_id and stored on the…

hari prasanth
- 716
- 1
- 15
- 35
1
vote
0 answers
nodejs express server send html file with dependencies
if i open the localhost, my html loads but not the dependencies like my css and the frame sources. How can i fix it. I searched for it but i could not find anything that worked for me.
and the nvs file also has its own dependencies.
my JS_FILE
const…

GregorBoxer
- 11
- 1
1
vote
0 answers
Smtp emails not sending from my Nodejs Host but sending from PC
I want to send my website mails by 3rd party mail server using Nodemailer.
When I send mails from my pc everything is ok but from my host No.
I set mail server MX records on Cpanel.
let transporter = nodemailer.createTransport({
…

stack CVL
- 15
- 6
1
vote
1 answer
Artillery not launching scenarios
I'm running my node server on http://localhost:5000 and wanted to do a performance test using artillery.
Here is my yaml file:
config:
target: http://localhost:5000
phases:
- duration: 20
arrivalRate: 3
name: Warm up
scenarios:
- name: Test1
…

kapil sarwat
- 97
- 1
- 8
1
vote
2 answers
NodeJS and MySQL Promise: Why am I getting ReferenceError: DataBase is not defined?
I'm just learning to use promises for MySQL in NodeJS. I'm using the following code to wrap my MySQL queries in Promises.
const mysql = require( 'mysql' );
let config = {
host : 'localhost',
user : 'myuser',
password :…

Meggy
- 1,491
- 3
- 28
- 63
1
vote
2 answers
Use IF Then statements with Promises in NodeJS
I'm just learning to use promises for my NodeJS MySQL queries. But I don't understand how to use IF THEN ELSE statements as a conditional to the next query. I basically need to check str_sql_4 for a tag. If it doesn't exist str_sql_6 is queried ELSE…

Meggy
- 1,491
- 3
- 28
- 63
1
vote
1 answer
Parse variable value from front end JS to the Node Serve.JS file
How can I pass the variable skip value from front end JS to the Node Serve.JS file? Currently these are the codes that I have. Any idea where I have written wrongly?
Server.js (NodeJs)
app.get("/api/routes", function(req , res){
// Configure…

Lawrence
- 165
- 8
1
vote
0 answers
Can't fix Error [ERR_MODULE_NOT_FOUND]: Cannot find module Node JS
I am currently developing an API in Nodejs but I am having problems with the imports and I cannot fix them.
I still have the error:
**Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/xxxx/WebstormProjects/app/src/loaders/index' imported…

SarahB
- 135
- 1
- 11
1
vote
1 answer
How to get PostgreSQL dump database file using Node JS
I tried to generate postgresql dump file using Node JS. SO, I used secure-backup library to generate pg-dump file encrypted. I add this package in my project and I configured .pem file also. When I execute this file it's throwing some error. but I…

Hariprasath Vengatachalam
- 155
- 6
- 18
1
vote
1 answer
Node.js: appending to readable stream WHILE it is piped to a writable stream?
My server receives udp packets of audio buffers.
I would like to stream these incoming chunks to Google's text-to-speech API.
Using fs streams, is it possible to achieve this in a manner that goes something like this?:
let stream =…

A S
- 75
- 8