Skip to main content

How to work with data in Astro

  • Can expose a collection on an API endpoint
  • When to do that vs using a server action?

Original video by Coding in Public:

Join early access for my Astro course! https://learnastro.dev

πŸ”— Key Links πŸ”—
- Github: https://github.com/coding-in-public/astro-working-with-data
- Json Placeholder: https://jsonplaceholder.typicode.com/
- Astro Endpoints: https://docs.astro.build/en/core-concepts/endpoints/
- Astro Content Collections: https://docs.astro.build/en/guides/content-collections/
- Astro Import: https://docs.astro.build/en/guides/imports/

---------------------------------------

πŸ“Ή Related Videos πŸ“Ή
- Astro Rendering: https://youtube.com/watch?v=aIHRjloFASU
- Content Collections: https://youtu.be/zUmqmuSvJMs

---------------------------------------

⏲️ Timestamps ⏲️
0:00 Introduction
1:19 Local frontmatter data
2:09 Fetch remote data
5:11 Import local files
9:40 Content Collections
17:02 Create JSON endpoints
23:54 Fundraiser

---------------------------------------
🎨 VSCode Theming
- Font: Cascadia Code: https://github.com/microsoft/cascadia-code
- Theme: https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-community-material-theme
- Icons: https://marketplace.visualstudio.com/items?itemName=BeardedBear.beardedicons

---------------------------------------

🌐 Connect With Me 🌐
- Website: https://codinginpublic.dev
- Blog: https://chrispennington.blog
- Twitter: https://twitter.com/cpenned
- Patreon: https://www.patreon.com/coding\_in\_public
- Buy Me a Coffee: https://www.buymeacoffee.com/chrispennington