Fetching from a JSON file with json server?

80 Views Asked by At

I am a complete beginner to front end and I have a lot of things to figure out. However, in a Vue.js project I'm required to fetch data from a json file as it was from a remote source. I decided to use json server. However the root of the json file is an array and not an object and I get an error when trying to run the server: 'Error: Data must be an object. Found array.' From what I have read, the root needs to be an object with a key(?). I am finding it difficult to find a workaround since I am not able to modify the original json file nor use a copy of it. Any beginner-friendly advice appreciated. Thank you!

I have not tried any solution yet

0

There are 0 best solutions below