94,957 questions
23
votes
4
answers
23k
views
CommonJS vs ES Modules for Express Node [closed]
Could anyone explain what is the best approach for node express app: CommonJS or ES Modules as of today? In the official documentation it shows that CommonJS module is used, however there are many ...
90
votes
20
answers
153k
views
Node.js, PostgreSQL error: no pg_hba.conf entry for host
I am following this article ((http://nodeexamples.com/2012/09/21/connecting-to-a-postgresql-database-from-node-js-using-the-pg-module/). I have already deployed my app to heroku and currently using ...
0
votes
1
answer
59
views
How to send cookies from server to client during SSR (Angular 20)
I am using HttpOnly Cookies for JWT authentication in my Angular v20 app. I have SSR enabled.
During Login, the cookies are sent to the client. I have an HttpInterceptor that seems to work to forward ...
0
votes
1
answer
66
views
I am having an issue with TypeScript and express-jwt
This is TypeScript code that I wrote a couple of years ago:
import { expressjwt } from "express-jwt";
import { Request } from 'express';
class Authentication {
static loginRequired() {
...
119
votes
5
answers
312k
views
How to use query parameters in Nest.js?
I am a freshman in Nest.js.
And my code as below
@Get('findByFilter/:params')
async findByFilter(@Query() query): Promise<Article[]> {
}
I have used postman to test this router
http://...
0
votes
0
answers
83
views
Handlebars: Access has been denied to resolve the property while requesting to post method
Handlebars: Access has been denied to resolve the property "status"
because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this ...
192
votes
22
answers
394k
views
Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
I am working with Node.js and Express.js.
I try to store an account in session. So, I tried to use a session with this code in Express.js
var RedisStore = require('connect-redis')(express);
app.use(...
1
vote
0
answers
21
views
Bun + Express on Vercel: How to Modularize Routes from Separate Files?
I'm deploying a Bun + Express application to Vercel. Locally, my Express app works perfectly with routes defined in separate files and imported into index.ts. However, on Vercel, the deployment ...
Best practices
1
vote
3
replies
41
views
Athena health api documents
I’m trying to build an application that can download patient documents from Athenahealth, but I can’t figure out whether this is actually supported. The official API documentation is extremely limited ...
3
votes
2
answers
9k
views
NodeJS, getting username of logged in user within route
I am getting in to NodeJS and have followed some video tutorials for making stuff, to understand NodeJS and Express. It turned more in to copying as little were explained, so tried to make my own ...
Best practices
1
vote
3
replies
65
views
How can I optimize my nodejs backend code for live data emiting for dashboard in UI
So I am working on a MEAN stack project where in node I will emit the data to UI and in frontend I had some widgets ( as charts like gauge , line , pie and table ) where user can add dynamically ...
1
vote
5
answers
2k
views
create server in 'node.js' VS 'express.js'
Hi all, I am new to node.js and express.js
I am having little bit confusion on creating server on node.js and express.js.
In Node.js we use the http module to create a server.
where as in express we ...
14
votes
5
answers
4k
views
Typescript node express router and second argument. Typescript-eslint/no-misused-promises
What should I do with function of registration to fix @typescript-eslint/no-misused-promises. The one way I found how to fix this problem is write by eslint.
"@typescript-eslint/no-misused-...
9
votes
7
answers
26k
views
Bull - Reached the max retries per request limit
I am using npm bull to add my queue job to handle sending mail for my project.
It runs without problems for a long time, but recently it shows this error:
Error while handling task collect-metrics: ...
6
votes
3
answers
18k
views
"Importing binding name 'default' cannot be resolved by star export entries" for hls.js
My folder layout in Node.js (I installed Express.js):
sdk-components
--- HlsLoader.js
node_modules
--- hls.js
--- src
--- index.html
--- index.js
--- ...
-3
votes
0
answers
66
views
Role and permission management for RBAC Express.js +TypeScript project
I need to implement role-based access control on the backend with postgresql, Prisma, and Express.js+TypeScript and the roles I have in mind so far are admin, manager, customer, delivery crew. I want ...
5
votes
2
answers
1k
views
Your package.json file is missing a build property inside the scripts property
I'm deploying my api with Vercel CLI, and when I run vercel dev I get this message:
Error: Your package.json file is missing a build property inside the scripts property.
Indeed, in my package.json I ...
1
vote
4
answers
1k
views
How to remove port from url for node application using nginx
My react and angular application (UI have two parts) are running using
node/express application on port 3000. On server.js (node-express entry point) I dynamically
handle which UI to render (react or ...
2
votes
2
answers
2k
views
Defining Websocket routes for Express
How can I define routes for Websockets using the ws library within an ExpressJS app? It's very easy to set it up the two layers in parallel, but the Websocket layer will not be able to benefit from ...
1
vote
1
answer
9k
views
How to pass request query parameters through a NodeJS application
I'm currently working on learning NodeJs and am running into a problem with passing query parameters. The stack consists of express, request-promise, and mongodb. The design of the application I'm ...
2
votes
1
answer
1k
views
How to add Joi validation to a input file for uploading image
I have a input file to upload image with multer. I want to add Joi validation to this Input for uploading images only , Im working with Node.js and Express.js
Code :
let schemaValidation = Joi.object({...
27
votes
5
answers
19k
views
Any way to serve static html files from express without the extension?
I would like to serve an html file without specifying it's extension. Is there any way I can do this without defining a route? For instance instead of
/helloworld.html
I would like to do just
/...
3
votes
3
answers
13k
views
How to query Enum using Prisma?
The goal is simple, I want to query enum field in the where clause. Example
prisma version is: "prisma": "3.11.0"
schema.prisma
model Todo {
id Int @default(autoincrement()) @id
...
2
votes
1
answer
94
views
How to add data from a client-side input field to my array websites[name] and then display it in html document
How to add data from an input field in the browser to my array websites[name], and then display it in a html paragraph?
server.js
import express from "express"
import { websites } from "...
3
votes
2
answers
12k
views
Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout
I am testing API for User functionality (signup and login) using jest.
Code for testing:
const request = require('supertest');
const app = require('../../app');
describe('Test User Functionality', (...