hope you’re doing well. i’m following a tutorial ( from 2019 ), and i’m facing this error at the moment. here’s the code. ( let me know if you need anything else ) // index.js // // User.js // // auth.js // Thank you in advance. The Lord be with you and save you all, your families and friends 🙂
Tag: express
try/catch block not working on express js
I try to create one route using express.js with a try/catch block, but when the conditions in the try block are not met, the code just loads without returning any value any solution for this problem? Answer You are not responding anything to the client in case name !== ‘name’ Add an else with a response, or throw an exception
JS fetch should do action on server write
Given is the following node stack: Client (VUE) (8080) Server (express.js) (3000) The client sends a get to a server route, inside the server route a task is running that takes some time but could easily been mapped because server is working over an array of data. Is it possible that the server can send a response (write?) which triggers
MongoDb query return empty object
I’m trying to perform a simple .find() query on my mongodbAtlas, but the result of this query is an empty object. this is my server file: this is my routes file: this is how my document is populated: Answer I think you are missing the “await” keyword after const data….. as API data fetching calls are asynchronous and required promise/
How to Display Value Created from API Onto My Browser?
So I am working with this API and it auto calculates the delivery fee based on the address you input. Here’s the API docs I am using https://developer.doordash.com/en-US/api/drive#operation/DeliveryQuote So when I add my values to my form and get my data, it logs the fee in my console like this My issue is how do I get this value from
I am trying to fetch information from phpmyadmin database, but in browser it’s showing cannot get/employee and in command prompt there is no error
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS E:Developmentcrud-node> node index.js Express server is running on port number: 8000 DB connection is successful Answer there seems to be spelling mistake in end point. The one you specified in error detail and the one defined in the code are different
Storing API Keys in react-native app with expo library
I have a question, please, if possible explain in simple terms. Im new to react native, what’s the best way to store API keys in a secure way where they can’t reverse engineer it and get the keys right away. Can I just retrieve it from the server side using a restapi to get the apikey only if user is
Cannot read properties of undefined (reading ‘fitness’)
We are currently making a website for our roommate matching project. We are at the point where we are making the results page, which should display the 3 most compatible roommates based on some questions where the algorithm calculates their compatibility percentage. We are now trying to pass the object called “fitness” that holds all of the results, which would
Two routes use params but only one is working
I’m trying to make a website that show you all the restaurants in the country with all th different cities. I add a route for restaurants that use params to redirect you to the restaurant page. And another route that also use params to take you to the city details page The problem is that only the restaurant route is
How to export and use a function using Express?
I have two file alarm.js and notifications.js. In alarm.js I need to call a method called sendPush from notifications.js. What I’ve tried : Exporting the function from notifications.js: Importing it in alarm.js and use it : The problem: I keep getting the error saying helperNotif.sendPush is not a function The question : How can I call this notification.js sendPush function