Home > Mobile >  How I can get response http url by axios in the server
How I can get response http url by axios in the server

Time:06-14

I have a problem with axios in REACT, it works on local but does not work when I deployed it. It say this : enter image description here

my Code :

import React, {useEffect, useState} from 'react'; 
import axios from "axios";

const Home = () => {
    const [data, setData] = useState([]);

    useEffect(() => {
        axios.get("https://recvueadmin.hellow.fr/api/question")
        .then((res) => console.log(res))
        .catch((err) => console.log(err))
    }, []);

I have this for CORS in the back-end :

app.use(cors());

CodePudding user response:

I don't think so there might be issue with the code. I would like to know if react is hosted on https or http as it can be blocked due to mixed content.

CodePudding user response:

Well it's resolve, it work on the all browers of my coworkers, but no mine, will try to resolve this.

  • Related