Category "node.js"

What is the proper format for HTTP POST Dynamic Zone data with Strapi API?

I have a Strapi user collection that looks like this. I am trying to use the API to create a new user with the "AdditionalInfo" dynamic zone filled with "Stud

Argument of type '{ title: string; }' is not assignable to parameter of type 'RequiredEntityData<Post>'

I'm learning from Ben's Awad video: Fullstack React GraphQL TypeScript Tutorial. I ran into a problem with typescript. I don't understand why compiler thinks t

How do I handle res.download(pathname) on frontend(ReactJS)

I have written a code on my server(NodeJS) that will send a .csv file to the frontend with express res.download(path). I would like to know how I can handle the

Why the Azure Event Hub get events so slow?

Event Hub is fast to send but slow to get. I use next code: subscribe(cb: (event: any) => Promise<void>) { this.consumerClient.subscribe(

How to link the imported dependencies of module created by vm.SourceTextModule to it?

Let's say we are creating a module called app by constructing a new vm.SourceTextModule object: const context = { exports: {}, console, // custom console o

How can I send documents with http request to power automate?

How can I send array documents and images with an HTTP request to power automate? I am using type script with nodejs as backend. Please see the code I am using

OrbitDB can't replicate database on different peer

I have forced with problem in my p2p database orbitdb. Everything works fine while I did not move the database to another server. const ipfsOptions = { repo

Why can't I connect to mongoDB atlas?

I am new in MongoDB, all my life I used MySQL. I have created an account in atlas, set the IP to my IP and created a user and saved the password. here is my cod

Image cannot be an array or an object

I am developing a project which consists of publishing a post and being able to upload a user image. I used JS for Front and NodeJs for Back (Multer for uploadi

How to get value from db.any() promise in pg-promise?

I use pg-promise and i tried to make a request to database in user model to get an array of all users like this: exports.getAllUsers = function () { let

how to deploy frontend(React.js) and backend(Node.js) in a single Heroku app

I have a parent folder named "app" and it has 2 children folders, "frontend" "backend" obviously both have different package.json files. In order to deploy it t

Next.js API routes all return "Interval Server Error" in production, but all the routes work in development

Whenever I go to any API route in my Next.js app in production it returns a 500 "Internal Server Error" but in development, all of them work completely fine and

countDocuments() is not working in api call

I am trying to get a count of products using api calls but in postman its keep loading router.get(`/get/count`, async (req, res) => { const productCount =

why npm install does not respect version in package.json

Nodejs version - 14.17.3 npm version - 6.14.13 I am confused over the difference in package versions - the one I have declared in package.json is different than

MongoStore.create({ ..............Cannot read property 'create' of undefined

I have tried every possible step I've come across but the problem doesn't resolve. The error shows: C:\Users\...............\server.js:35 store: MongoStore.crea

Failed to connect SQL Server from Node.js using tedious

I am trying to connect to SQL Server in our domain network. I am able to connect using python but not able to connect in Node.js using Tedious. Node.js code sni

How to solve AWS Elastic Beanstalk 504 Timeout Error?

I am using AWS Elastic Beanstalk for hosting Express/Node.js API server. It's working well with just normal APIs but I am getting this 504 Timeout error with on

Client-side jwt token storage

I need advice, what is the best way to store a JWT token? Should we store in cookies or storages? But with the CSRF flaw and xss attacks I have a doubt. I'm sti

why I can't get all folder's module with require('./folder')

i am using this: index.js functions └abc.js └reset.js functions.js functions.js const fs = require("fs") const functions_ = {} const files = fs.re

While deploy the MERN Stack at DigitalOcean error TextEncoder is not defined

My app works on development but gives Text Encoder error in production. When I run the Node index.js command, I get the error "TextEncoder is not defined". Erro