Questions tagged [node.js]

Node.js is an event-based, non-blocking, asynchronous I/O runtime that uses Google's V8 JavaScript engine and libuv library. It is used for developing applications that make heavy use of the ability to run JavaScript both on the client, as well as on server side and therefore benefit from the re-usability of code and the lack of context switching.

Filter by
Sorted by
Tagged with
0
votes
0answers
2 views

Iterate over rows in smartsheet and indent based on value in column using node.js

Hi again wonderful helpers, My Smartsheet and node.js world is expanding :-), but now something I don't know how to approach. I have a flat structured smartsheet with around 1000 rows and I need to ...
-1
votes
0answers
11 views

What should the project structure of a simple Node.js application look like?

By simple, I really meant simple. I'm not working with express or react or anything like that, I just have a script that does some runs some simple API requests and uses a database to store some ...
-1
votes
0answers
8 views

No logro conectar mi nodejs socket.io con otro Nodejs que tengo un servidor

La cosa es que tengo un arduino, el cuál NodeJS recibe su información y esta con socket.io los envia a otro NodeJS que teno alojado en el servidor Heroku, pero no logro recibir esos datos de este ...
-1
votes
0answers
10 views

I am creating a chrome extension that works alongside my website?

I am starting a project and a little confused on how to get started The chrome extension will have a login page, which can only be signed if someone created an account on the website. once signed ...
0
votes
0answers
9 views

role based login in Angular

Roles are employee and admin. i have created api that is generating token now i want to add roles on login means if employee logged in he should be directed towards respective pages and admin should ...
0
votes
0answers
10 views

Next.js api route with IP address

Inside one of my next.js api route, For example: pages/api/example.js I have the following simple code. Then, inside this route, I have post request to a server. export default async function example(...
0
votes
2answers
18 views

nodejs get raw body from POST request

I have an alert in tradingview that send a webhook with a request to my server with a plain body that has some info. the webhook sends PLAIN TEXT, It doecnt sends JSON data. I was wondering if there ...
0
votes
0answers
7 views

Electron - Uncaught Error: EROFS: read-only file system

I am using Electron to build a desktop app. At UI, I built a file input component. After people upload their file. I want to move the file to the designated location. My way to move the file is to ...
0
votes
0answers
18 views

Is there a way to make request wait before getting the data?

I am trying to make a scraper for a website, but when I scrape the site, request doesn't give the page time to load the items. Is there any way of delaying the data capture of request? I can't seem to ...
0
votes
0answers
16 views

Client-side validation THEN pass to server OR disable submit until form complete - How do I do this?

export default function RegistrationForm() { useEffect(() => { const getAPI = () => { const API = 'http://127.0.0.1:5000/'; fetch(API) .then((...
0
votes
0answers
8 views

Authenticate User using context Api

I am trying authenticate a user. I am using context api to manage my states. I want to use the authentication to specify protected routes, in a bid to do that, i am making use of ComposedComponent. ...
0
votes
2answers
19 views

how to ignore case on sql query

i have this sql query: var userLogin = "select * from login where USERNAME = ?"; the problem is, some of the usernames are testDummy123@gmail.com, but users may enter it as testdummy123@...
-4
votes
0answers
17 views

npm install get stuck on fetch POST 400 [closed]

i got a npm stuck when install npm, i have try to see with the --verbose, and it happen in fetch POST 400 enter image description here
1
vote
0answers
16 views

Is it possible to call Kotlin from JavaScript via Graal?

This works var NodeTransformerClass = Java.type('com.fispan.crypto.api.java.NodeTransformer'); var nodeTransformer = new NodeTransformerClass(); var result = nodeTransformer.protect(customer, ...
0
votes
2answers
36 views

Why does my Discord.js bot take more than five minutes to respond on a server with less than 500 users?

I've just developed a bot for adding roles to a user who starts streaming on my server. When I tested the bot on a isolated server with only a few channels and users the bot responded instantly. But ...
0
votes
0answers
6 views

heroku showing cannot get/index.html

I am trying to deploy in heroku, I am not using react. I get the error as Cannot get /index.html. I have a server folder with index.js,package.json and other js files. And a public folder with html ...
0
votes
0answers
11 views

Parsing multipart/mixed responses with Node.js and axios

I've trying to parse a multipart/mixed response with (1) JSON and (2) .zip file. I've been using Axios to GET the response, no problem there. I've seen npm packages like meros and multipart-mixed-...
0
votes
1answer
18 views

page.save() is not a function - Mongoose

const addUSDCurrencyToCreatorPage = async () => { try { const page = await Pages.find({ username }); console.log("page --", page); page.currency = "USD"; await ...
0
votes
1answer
13 views

Clean ZSH pwd prompt from Node.js

I've recently updated the Node.js installed in my machine with nvm install --lts and my ZSH terminal now shows: ~ via ⬢ v14.17.3 how can I clean this "prompt" pwd message? It's constantly ...
-2
votes
0answers
12 views

What Node.js DB should I go with? [closed]

I am building a Node.js app and I need a KEY-VALUE DB that stores its data online. I have already tried thisdb and kvdb.io. I also don't want my data to expire after a month. Is there another option ...
0
votes
0answers
7 views

Chrome Extension Missing Set-Cookie Header

I'm attempting to use Fetch in a chrome extension to make requests to other domains, in these requests I need to access the "set-cookie" header. I wrote up some code in Node.js which is able ...
0
votes
1answer
16 views

Module parse failed: Identifier 'ɵngcc0' has already been declared ANGULAR

Good day everyone, I'm doing a personal project but at the moment of using: import {NgForm} from '@ angular / forms'; The error appears, I've tried the command of "npm ci" and then re-...
0
votes
0answers
12 views

After globally install Typescript, npx create-react-app is not working

After globally install Typescript, npx create-react-app is not working. I have tried with --force, or --legacy-peer-deps but still its not working. Here is the error
1
vote
1answer
20 views

How to update nested object in a MongoDB collection based on the request?

I've a collection for user given below { "_id": 1 "firstname": "John" "lastname": "Doe" "address": { "street": "...
0
votes
0answers
6 views

Filter on tag-field on children

First of all, I'm not sure I've set this up as it should be, like by the book. I'm from the SQL world and jumped into the NOSQL land. Ok, so. I have this collection with Projects, and inside the ...
0
votes
0answers
7 views

How to globally edit http options for all node.js modules?

I have what I think might be a unique question (I certainly cannot google an answer for it). My organization is using passport.js to authenticate invocations of our lambda function before that lambda ...
0
votes
2answers
26 views

What's the best way to re-run a const-declared function?

New to ES6 here. I have a function declared "inside" a constant: const requestData = https.request(source, function (res) { ... <function code> ... }); I need to re-run this ...
0
votes
2answers
39 views

In Angular, how can one component to have multiple HTML templates?

I am developing an ecommerce application, and one major feature is that this app should have multiple themes. The total number of themes could be 100 or even more. However, these themes all have the ...
0
votes
1answer
8 views

Can´t use data from a textarea and make an update Mongodb Express.js

im building a simple notes App using express and mongoDB, i got this kind of bug where i cant update the description of the Notes, just the title, this the form from where im getting the data <div ...
0
votes
2answers
19 views

Reactjs - Error: Objects are not valid as a React child (found: object with keys {type, data})

I am trying to display mysql data to a table using nodejs and reactjs. For some reasom I keep the folowing error: Error: Objects are not valid as a React child (found: object with keys {type, data}). ...
0
votes
1answer
15 views

Node: Sending Protobuf message to Kafka Error

I am trying to use the HDFS kafka connector to send protobuf messages from kafka to the HDFS. My connector config looks like the following { "name": "hdfs3-connector-test", ...
-1
votes
1answer
19 views

Angular project is not running properly

I created a new Angular project. Project name is "PaymentApp". After "ng serve" it starts running but showing lots of errors. On chrome, it's showing "Cannot GET /" ...
1
vote
0answers
21 views

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 ...
0
votes
0answers
10 views

Problems with gulp-file-include

This is the link of the project: https://github.com/rtavares00/gulp I added the following line in gulpfile.js : gulp.task('fileinclude', function() { gulp.src(['html/layout1/*.html']) .pipe(...
0
votes
0answers
11 views

How to retrieve data from Mongo DB via node js in the same order as in Model

I am trying to get data from mongoDB but the unwanted data are coming at the top , it is not in the order as i have added in the Mongoose schema . Category schema : const mongoose = require('mongoose')...
0
votes
0answers
10 views

nginx proxy for nodejs websocket is not working

I am trying to run Nodejs web-socket using Nginx proxy server both are on different machine nginx is on public IP and websocket is on local machine and can be accessible via DNS name but it is not ...
1
vote
0answers
27 views

How to solve Mongo Error: E11000 duplicate key error collection [duplicate]

I want my users to have a phone OR an email (at least one of them) that's why I used these options for phone and email in my schema: const schema = new Schema({ phone: { type: String, unique: ...
0
votes
1answer
16 views

React socket io client emitting twice to node server

I am making a react app with node as backend. They communicate using socket-io. The problem I am having an issue where react does and emit to send data to node, but does it twice, thereby making a ...
0
votes
2answers
24 views

How to call dynamically generate function name and parameters [duplicate]

I am trying to condense a potentially large switch case into a simple expression in nodejs. This is what I current have exports.ManagerRequest = functions.https.onCall(async (data, context) => {...
0
votes
0answers
5 views

How do I get the name of the partial loaded by handlebars.js ( client or server side node/express )?

{{>partialname}} How do I get "partialname" above? I can get the layout file name and the root template name, but this method which uses exposed variables by the register helpers does ...
0
votes
1answer
13 views

find in array of mongoose subdoc to return array of documents with similar fields

these are my schemas and the queries are: (list's id and a question topic) questionSchema is nested inside the listSchema. const questionSchema = new mongoose.Schema({ topic: { type : String , ...
0
votes
0answers
19 views

Get Value From CoinMarketCap API

I have been trying to show a value from CoinMarketCap API without success. { status: { timestamp: '2021-07-23T15:48:49.204Z', error_code: 0, error_message: null, elapsed: 26, ...
0
votes
1answer
10 views

How to connect to Heroku PostgresQL database from Express?

I am trying to deploy a PERN app to Heroku. I created a Heroku Postgres database and deployed my React frontend - Node/Express backend app to Heroku. How do I connect to the database from within my ...
0
votes
0answers
15 views

Node SQLite3 Changes not saved

Context: I'm working on a Web App with Express Backend (Express & SQLite as Database) Problem: If i make an API Call to Update some Rows in the Database, it (seems) to be working. If i query it, ...
0
votes
2answers
21 views

clearing browser cache react js

I have an application running node.js in the backend and react.js at the front. I have encountered a bug that happens when I log in as a admin, log out and immediately try to log back in as a customer ...
-1
votes
0answers
6 views

Is there anyone familiar with x-kpsdk-cd headers?

The header has work time, id, and answers. I'm trying to figure out what this is and how it is being generated.
1
vote
0answers
19 views

Material ui is not working properly with next even though i am following the methods mentioned in material ui docs

These are the problems i faced with nextjs and material ui I am getting this error, if i use props with makestyles [enter image description here][1] This is the error i am getting [1]: https://i....
0
votes
0answers
15 views

How we are able to import third party packages like express with both import syntax (es6) as well as require (commonjs) in Node.js?

Out of curiosity I opened express package and inside there was module.exports....but still we can import with es6 syntax. But when it comes to modules that I export as commonjs module, and try to ...
0
votes
1answer
24 views

Creating a relative path for a simple app

index.js var fs = require('fs'); var obj = JSON.parse(fs.readFileSync('/Users/amelie/Documents/project/config.json', 'utf8')); I compile this file into an app called test-macOS using $pkg index.js . ...
0
votes
0answers
20 views

Is it possible to use app.use inside the if else statement in Express

I want to check whether user is logged in or not. If the user is not logged in I want to restrict the access. I've used express-rate-limit and setting the rate limit inside if statement but its not ...

1
2 3 4 5
7909