// create services folder and api file import axios from "axios"; export const api = axios.create({ baseURL: " http://localhost:3333", }); // on the page where the useEffect is located import { api } from "./services/api"; useEffect(() => { async function getData() { const response = await api.get("/episodes"); setData(response.data); } getData(); }, []);