Fetch content from external sources
See original GitHub issueIs your feature request related to a problem? Please describe.
I’ve got some articles in a database which can be accessed by a REST API. It would be great to access these articles from Nuxt Content.
Describe the solution you’d like
For example: const { title } = await this.$content('https://some-api/article-1').only(['title']).fetch()
Describe alternatives you’ve considered
Instead of accessing them like above. Download markdown files to the content directory and access them in the regular way.
Thanks for all the hard work and the awesome new features!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Fetching data from the server - Learn web development | MDN
This article shows how to start working with Fetch to fetch data from the server.
Read more >Fetching data from external API | OutSystems
I'm using Reactive Outsystems. I wanted to ask about fetching Data from external source (API). I followed this tutorial: https://success.
Read more >Problem with fetching from external source - Stack Overflow
The best you can do is to proxy the URL through your own server. Create an endpoint on your own server that proxies...
Read more >GET data from external REST API & display with HTML/CSS ...
Learn how to fetch data from external REST API and using DOM manipulations, create HTML elements on the fly and display the data...
Read more >Use Microsoft Query to retrieve external data
You can use Microsoft Query to retrieve data from external sources.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @janekkkk,
Nuxt Content parses markdown files on the file system on load and builds an API around the database generated from the content directory, it cannot be used on eternal sources.
You’re alternative seems the way to go.
I also would like to be able to host my markdown files in Firebase Cloud Storage and fetch them at runtime via an API. I already figured out hot to dynamically generate the routes. The only thing I haven’t figured out is how to parse the markdown into the <nuxt-content> tag. Some of my markdown files have vue components in them, so a 3rd party API isn’t a feasible option for me.