Suppose I have assets/data/geo/regions.json
file in my NUXT.js project folders structure. How can I read data from this file into my project?
I have tried axios but I don't know what URL will have this file, I have tried all possible URLs. What is the better solution to do that? Maybe better to hold JSON files in static
folder?
Thanks!
If the regions.json
file won't change, you can easily put it in the static
folder.
Then the url will be /data/geo/regions.json
See this question on the nuxt issues page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With