I am attempting to use the axios library in my Next.js app (written in TypeScript) to access a public API for retrieving IP addresses from .
In my index.ts file, I have the following code:
import axios from "axios";
export const ipApi = axios.create({
baseURL: "https://api.ipify.org",
})
However, when I attempt to make the API call like this:
const getIP = await ipApi.get()
I encounter an error message stating "Expected 1-2 arguments, but got 0.ts(2554) index.d.ts(223, 47): An argument for 'url' was not provided."
Can someone please help me identify what I might be missing or where I may have made a mistake? Apologies for any language barriers.