Category "node.js"

How to Insert new documents according to a condition that can be appliyed on one of them

I have a collection where I store unique uID for a user and I also have to register them manually. While registration I pass multiple IDs in an array and now I

JS QUESTION: how can i make it so that when im detecting a word inside a string, i check standalone words like Hello

How do i check for the word "Hello" inside a string in an if statement but it should only detect if the word "Hello" is alone and not like "Helloo" or "HHello"

I can't figure out why I'm getting a ReferenceError: fileUploaded is not defined

Hi this is my first post! Here's the error I'm throwing when trying to submit a post on a website I'm making! This is the error and line 36 is where i call shar

Node/Express I can't get the header set up in my route

I have a backend that uses Node and the Express framework and a frontend in React. The code is in Typescript. My backend uses the elastic search client to fetch

How to change port using fetch and request react js?

This is the code I took from my professor's tutorial. LoginComp is just {username: '', password: ''} const request = new Request("/users/login", { method: "

Listing GitHub users with their repos count

I want to list GitHub users with their repos count using GitHub rest API. I tried to send request (https://api.github.com/search/users?q=${q}&&per_page=

Error from chokidar : Error: UNKNOWN: unknown error, watch

In a new Angular app I'm getting the following error: Error from chokidar : Error: UNKNOWN: unknown error, watch I've deleted and re-installed node_modules, dow

New Google Sign In library prompt at every page reload

In my project, I use regular popup client-sided JS authentication (platform client) I migrated from old Google Sign in to new Google Identity Platform (gsi cli

TypeError: User.generateAuthToken is not a function

userSchema.methods.generateAuthToken = async function() { const user = this const token = jwt.sign({_id:user._id.toString()},'thisisnewcourse') ret

How to import ".mjs" modules in Jest's xyz.test.js?

I want to use Import/export feature of ES6 modules (since my entire project uses that) with Jest 26.1.0. I have created a directory for my test cases called tes

Trouble fetching token from localstorage - React

I'm new with react and i'm trying to create a basic login function using local storage and tokens. I can see in my devtools that a token is actually stored but

Package.json with multiple entrypoints

I have a library which was used as follows import { Foo } from '@me/core'; const foo = new Foo(); The package.json of that library looks like "name": "@me/core

How to propagate context between two services communicating via rabbitmq in opentelemetry?

I am trying to find a way to propagate context between two services communicating via rabbitmq in opentelemetry. There was an article for doing similar in Go ar

How can solve problem in installing build tools

I'm trying to install build tools on my OS (Windows 10) but it always stay in the same state. Like picture Build tools error image PS C:\WINDOWS\system32> np

Strapi giving me DB errors in production, even though I'm using correct credentials

EDIT: I found a file at /config/database.js which is used to connect to sqlite in development. When I change the client name from sqlite to postgres, that's whe

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