All Questions
1,529
questions
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 ...
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 ...
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
},...
1
vote
0
answers
205
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 ...
-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 ...
1
vote
1
answer
29
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 ...
1
vote
1
answer
30
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 ...
0
votes
1
answer
111
views
Deploying a backend on Render causes a 'Refused to load the font' error due to Content Security Policy, how do I fix this?
I deployed a backend on Render successfully, but when I go to the link the API returns a 404 error:
Refused to load the font 'data:font/truetype;charset=utf-8;base64, ...
0
votes
1
answer
137
views
How to nested map for res.json() in express
I am working on an express application (server-side) that provides movie information to users but I am trying to send a JSON response like this:
{
"title": "Star Trek: First Contact&...
1
vote
1
answer
60
views
Express+PostgreSQL backend: Where to check correctness of data?
I'm developing a REST API with Node/Express and PostgreSQL as backend. Some of the endpoints to insert data to the database are a bit more elaborate in the sense that they insert items in multiple ...
0
votes
1
answer
175
views
How to set cookies in the browser from the header sent from express app
app.js
const express = require("express")
const cors = require("cors")
const bodyParser = require("body-parser");
const app = express();
app.use(express.json())
app.use(...
0
votes
0
answers
296
views
ERR_BLOCKED_BY_RESPONSE Error loading image from Nodejs API
I am developing Rest API using Nodejs All my routes are working fine but I can't load images.
I am getting this error net::ERR_BLOCKED_BY_RESPONSE.NotSameOrigin 200 (OK).
Below is my Route config ...
0
votes
0
answers
189
views
Axios Error message: 'Request failed with status code 404'
I am working on a mern app and I triedto fetch the restaurants from the database when the user types a restaurant name in the search bar. However on making an axios get request, the console shows this ...
1
vote
3
answers
56
views
How to pass the value of a req.body.name from post route in app.js to an API endpoint in a module.exports js file
I am using node/express and EJS, along with postgres database.
I have 3 inputs in my home.ejs file named:
title, platform, genre.
These are contained in a form so I can create a post request.
and ...
1
vote
1
answer
546
views
json-server with express api with requests to external api - gets 404 error responses
I am developing an interface api that receives a request from a client to that external api, and redirects it to it.
That api has a database file (userData.json) to store the users data, including ...