Questions tagged [nodejs-server]
405 questions
3
votes
1 answer
How to implement database first approach in Nest JS
I have three schemas(User, Account, Contact) these three schemas used to created a model and generate the migration files also Next, this migration file migrate the PostgreSQL Database this part successfully completed using Nest JS.
Next, Manually I…

Hariprasath Vengatachalam
- 155
- 6
- 18
3
votes
2 answers
Socket.IO using Node.js and Swift server not detecting connection? [AWARDING SOON]
When I try running SocketTutorialManager.init() when a button is pressed, the different functions in the initializers should run, but they don't and I instead get the following printed to the Xcode console:
'sockettest[70290:1461156] []…

nickcoding
- 305
- 8
- 35
3
votes
0 answers
Performance implications of using Async Hooks
I'm the author of a Node.js library and I want to use Async Hooks to improve DX. But I'm worried about performance.
I've read stories saying that everything is fine, as well as stories where performance was a blocker.
In theory, asynchronicity…

brillout
- 7,804
- 11
- 72
- 84
3
votes
2 answers
close server from within router
I create an express app like this
const express = require('express')
const app = express();
app.use(express.static(path.join(__dirname, 'public')));
app.post('/close', async (_, res) => {
res.status(200);
res.end();
…

theonlygusti
- 11,032
- 11
- 64
- 119
3
votes
2 answers
How to keep a Node JS server running on shared hosting
I was looking to test a node server in a shared hosting environment.
I'm using an ssh terminal session to test.
The server works fine, but of course you can't leave the terminal session without stopping the server.
Using pm2 (npm package), I'm able…

WhatsYourFunction
- 621
- 1
- 9
- 25
3
votes
1 answer
How does A Node.js Web Server Keep Running Even When There Are No Callbacks To Be Executed In The Event Loop?
The code below is a simple Node.js web server that responds to a request when the URL is matched.
Researching online about node.js it is stated that once you start your script (node index.js) callbacks will be placed in their appropriate phase,…

claOnline
- 1,005
- 3
- 10
- 18
3
votes
0 answers
How to calculate the appropriate value of UV_THREADPOOL_SIZE for a NodeJs application
I have a NodeJS application using express as web framework, exposing a single API that receives a JSON file and uses the data of the json file to fill up a word document template and generate a PDF which is delivered as download in the API…

T.S.
- 192
- 2
- 13
3
votes
2 answers
Does NestJS comes with security practices already?
Does NestJS handles some security practices out of the box?. If not, what recommendations can you share to secure a NestJS application besides helmet? I see in the NestJS middleware docs an example using the helmet dependency.
When using TypeORM,…

Marcos Navarro
- 33
- 1
- 4
2
votes
1 answer
Mongoose is not able to connect to nodejs app
I am trying to connect Mongoose with my nodejs environment but it is giving an unexpected error. Before I was able to connect with mongoose with the same commands, But for few days its giving error
index.js file
import express from 'express';
import…

YASH NIRMAL
- 23
- 5
2
votes
2 answers
How to set the Content-Type of a Js-File in NodeJS-App
i have a problem opening a js-file on my NodeJS-server, because it will always specify my .js-file with a Content-Type of "text/html".
The goal is to send user-input from a html-form to a JavaScript-file for doing some calculations and later create…

Morizzla
- 23
- 6
2
votes
1 answer
How to open an EJS file with Live Server
I have a Server App created with Nodejs using "ejs" view engine.
When I start the Server and is running on the port, I click the URL and it sends me to my APP with no problem.
When I try to do it with Live server is when I am facing issues.
In Live…

Julio
- 175
- 1
- 17
2
votes
1 answer
Swagger UI is not displaying anything on Amazon EC2 instance
I have developed Node.js App using Express framework and documented using "swagger-jsdoc" and "swagger-ui-express".
Swagger UI is loading on my "localhost:3000/v1/docs" and working properly.
Now, I deployed it to Amazon EC2 instance (Ubuntu, Linux),…

MUHAMMAD MUJTABA
- 21
- 3
2
votes
2 answers
Can someone explain me why .env variables are undefined when I print them?
I've done a Node JS server with ES6 using import and export, but when I want to access to an enviroment variables to print that, they return me "undefined". This is my code :
import express from 'express'
import bodyParser from 'body-parser'
import…

ricmiber96
- 21
- 3
2
votes
1 answer
In passport not getting req.user value in node js
I have an app in node js with javascript and I am trying to get the req.user but it's coming.
Below is the code example which I am using
const app=express();
var bodyparser=require('body-parser');
var session=require('express-session');
var…

Zia
- 1,001
- 1
- 13
- 25
2
votes
0 answers
NodeJS 12 application on macbook pro M1
do you have someone a solution for this problem?
The problem is on my nodejs application on new MacBook pro M1. I have a project built on nodejs 12 and enabled ES2015 import/export class. On my old MacBook, everything works fine but on my new mac…

user13746
- 840
- 4
- 8
- 22