Dynamic API Endpoints in Astro
ฝัง
- เผยแพร่เมื่อ 25 มิ.ย. 2024
- Join the early access for my course! learnastro.dev
🔗 Key Links 🔗
- Github: github.com/coding-in-public/a...
---------------------------------------
📹 Related Videos 📹
- Astro rendering options: • Choosing between SSR, ...
---------------------------------------
⏲️ Timestamps ⏲️
0:00 Introduction
1:18 Dynamic static files
6:35 React w/ endpoint
11:15 SSR CRUD functionality
23:55 Dynamic routing with endpoints
---------------------------------------
🎨 VSCode Theming
- Font: Cascadia Code: github.com/microsoft/cascadia...
- Theme: marketplace.visualstudio.com/...
- Icons: marketplace.visualstudio.com/...
---------------------------------------
🌐 Connect With Me 🌐
- Website: codinginpublic.dev
- Blog: chrispennington.blog
- Twitter: / cpenned
- Patreon: / coding_in_public
- Buy Me a Coffee: www.buymeacoffee.com/chrispen... - แนวปฏิบัติและการใช้ชีวิต
Thanks for this. I was a little confused as to why you mention the public/data.json file but you then go on to use the yaml files as the source of your data.
Awesome, as always. Thanks, Chris!
Glad you enjoyed it!
Thanks for sharing such valuable content.
Ohhh this is nice, I have a use case for this, I have a content collection of locations which contains a lat & lng coordinate. I need the lat & lng of each content collection to create pins and info windows on a Google Map. Boom! Thanks Chris
Thanks thanks for this video yor content its amazing
Good one 👍, thanks ❤
You're welcome 😊
I have a question, for example, if we have a products section on our main page that lists products (without using integrations from other frameworks).
/products
Going to that section with a tag pauses the main page until the data on my product page loads. How could I avoid that and give feedback to the user while making the request to my product page API endpoint on the front-end? (skeleton or some loader state).
i used astrojs to build my portfolio and its always a hassle to update the projects im working on i think i will try this. And is there away to i can set it to fetch Readme as project details?
Check analogjs it uses astro islands which is angular for all the complicated logic + astro for the SEO gifts it gives, i'm personally doing multiple projects on it.
Not sure why this is happening but for the dynamic static file version, the browser will automatically download the JSON instead of displaying it in the browser.
It seems that if I don't apply a header of "application/json" in my response, the default is "application/octet-stream" which I assume causes the browser to handle the file by downloading it.
could you try keystatic ?
Hopefully soon. I’ve used it in a few projects. Just got too much going on with my course to do a tutorial quite yet on it.
Why your terminal so beautiful, can i do that in windows ?
Look up installing zsh and ozsh.
I need to learn how to create membership pages, based on user level of suscription...? Blogs are great, but already have wordpress....
Sounds like you need some auth :) I'd check out Lucia auth. I've been playing around with it and am very impressed! Works well with Astro db, too!