Skip to main content

All Questions

Tagged with
1 vote
0 answers
94 views

Mongoose:Error when send a second request on the server

I'm making an API for my app, the app is in MERN stack, I make a separate Database for every account and its information (every account along with it's info is in a separate DB so each DB for each ...
Quiet Coder's user avatar
0 votes
1 answer
59 views

Call to local api does not work in the browser but shows success status with Postman

I am creating an image generation website with Mern. One of my functions named handleSubmit, calls for a local API. The API is not fetched when running in the browser but runs fine when tested with ...
Adit Ramdas's user avatar
1 vote
2 answers
76 views

axios API not receiving data from express js nodejs

client const {data} = await axios.create({baseURL:`http://127.0.0.1:5000/api`}).post("/seller/login",{ sellerMobile, sellerEmail, password },...
Shubham Garg's user avatar
1 vote
0 answers
203 views

I'm trying to deploy my API in fly.io, but I want to deploy my html/css/scripts too (I used my API in they). How can I make it?

Well, I've made an node express API, and now I'm trying to deploy it on fly.io. The API deploy is well working, but in same folder of API i got another one with HTML/CSS/js files and I'm trying to ...
jnx's user avatar
  • 11
0 votes
1 answer
34 views

Sort by value of multiply field a and field b in mongodb

I have farm collection that has apy and liquidity. I want to get top 10 results by order of value of apy * liquidity I tried like this. var data = models.farm.find().sort({ $expr: { $multiply: ["$...
Li 1001's user avatar
  • 75
0 votes
1 answer
29 views

How can I update a user's account with purchased products if the PUT request requires administrator permissions?

I have a website that sells specific products and uses Stripe for payment processing. The process consists of two possible steps: first step: Users without an account add products to their cart. The ...
Cesar's user avatar
  • 13
0 votes
0 answers
81 views

How do I solve unexpected end of JSON error and HTTP 500 error on my Next.js app hosted on cPanel?

I have an app when i run it on localhost everything works fine but on hosting (supports Cpanel) I'm working with api folder it throws 500 error: unexpected end of JSON and two other errors for get and ...
Oualid Sahnoun's user avatar
-1 votes
1 answer
35 views

How to properly format rapidAPI data on a React frontend

I building a project with Node, express and React and I have to use an API from RapidAPI. Currently, it's only rendering the data in JSON format. So how can I get the data from the server coded with ...
Jaiylon's user avatar
  • 175
1 vote
1 answer
27 views

How to Restrict a Student in MERN to mark his Attendence only once a day If he marks his Attendence again for the second time he should get an error

I am making Student Attendence System in MERN Stack and for that I am making an API in Nodejs/Express.js that will mark the attendence of a user . I am having a problem that how can I implement that ...
Azeem Chaudary's user avatar
1 vote
1 answer
29 views

Server 404 NodeJs

I created a server and connected it with MongoDB when I made an API in the index.js File, it is coming, but when I created an function for the same and made an API in another file and exported to ...
Khushi Sanghvi's user avatar
0 votes
0 answers
22 views

Is there any method that I can use to properly implement the delete and edit logic in this code and alternative for select to choose multiple roles?

I could not delete and edit properly this code. I always got an error when I want to delete and edit the newest user I created. I couldn't set multiple roles, I have tried React Select but i could ...
Leff Tubat's user avatar
0 votes
1 answer
25 views

When use post, when use get

I have a doubt, I have an API in which I will pass a JSON to get data referring to a request. So is it necessary to use the ResquestBody, in this case, do I use GET or POST?
Mateus Bodanese's user avatar
-1 votes
1 answer
76 views

Can I query a googleSheet using googleapis npm package?

I have a sheet that has thousands of rows and I am trying to query it instead of fetching everything every time. I took a look at the Query language, but it doesn't seem to fit my case. I'm using a ...
Allan's user avatar
  • 343
0 votes
1 answer
206 views

OpenAI Dalle Node createImageEdit 400 Error

I am trying to use the OpenAI package in Node to send an edit request as follows: let response = await openai.createImageEdit( fs.createReadStream('assets/cute_cat.png'), fs.createReadStream('...
shilleh's user avatar
  • 21
0 votes
1 answer
67 views

Is there a way to not send API key with the request everytime in Nodejs? [closed]

I have made an API key for certain users like this : var uuid = require('node-uuid'); var createUniqueId = function() { return 'User:' + uuid.v4(); }; Yet at this level I request the API key in ...
Hypothesis's user avatar
  • 1,336

15 30 50 per page
1
2 3 4 5
317