1

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());

SamCoding
  • 31
  • 6

0 Answers0