Answer the question
In order to leave comments, you need to log in
Why is no response coming from the server?
Here is the request to the server
export const postYoutube = async (data) => {
const result = await axios.post('http://localhost:5000/api/google', data);
console.log(result);
};
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json());
app.post('/api/google', (req, res) => {
console.log(req.body);
res.send('Server is running');
});
res.send('Server is running');
const result = await axios.post('http://localhost:5000/api/google', data);
console.log(result);
Answer the question
In order to leave comments, you need to log in
Look at the console.
I am tormented by vague doubts that you have mixed content.
The page is opened via https, and you send requests via http.
Through pribludy a la postman requests pass?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question