So I have been researching everywhere for this but wasn't able to reach a sensible conclusion. I imported { useRouter } from next/router and successfully parsed a local JSON file, but I would like to parse a JSON object from a URL. Here is one URL for example: http://time.jsontest.com/
I feel like I have tried everything but failed... Basically I am using Shopify API and want to access our database of customers from a JSON for a Dashboard. We are experimenting with NextJS and TypeScript right now, but I don't know. I find it tedious. I just need one example or resource that can help me..
fetch('https://jsonplaceholder.typicode.com/todos/1').then(res => res.json()).then(json => console.log(json)), but in TypeScript?