Build and Test a RESTful TypeScript API With Astro, Postman, and Xata

preview_player
Показать описание

In this video, we'll work with live data by integrating with a Xata database. We'll use the Xata client generate TypeScript types for our data as well. We'll also use the Postman VS Code extension to be able to test our API endpoints.

**DISCORD**

**STAY IN TOUCH 👋**

**QUESTIONS ABOUT MY SETUP**

00:00 Introduction
01:24 Astro Overview
03:43 Server API Endpoints in Astro
04:45 Handling API GET Requests in Astro
08:57 Connecting to Xata Database
15:11 Handling API POST Requests in Astro
19:35 Handling API DELETE Requests in Astro
23:01 Handling API PUT Requests in Astro
24:22 Learn Astro 3.0
25:11 Conclusion
Рекомендации по теме
Комментарии
Автор

very interesting James. I did not know this was this easy now, and also nice to learning about xata. Using supabase now, but will try xata soon

TomHermans
Автор

thanks. helpful figuring out the endpoint types, struggled finding that in the docs

colbyfayock
Автор

This was helpful! Can you do a video on authentication with astro?

null_spacex
Автор

Thank you for the video, that’s really helpful 🍻

andrianrahardja
Автор

Great video. I was just curious to know whether there is any advantage in setting up your apis this way using astros format to connect directly to a db or calling cloud functions (I’m using Firebase functions to create the api endpoints) from the Astro site pages frontmatter? I’m just wondering if this method might be faster as the SSR process contacts the db directly rather than via cloud functions.

jameshuggins
Автор

Excelente, siempre es un buen momento para aprender algo nuevo, muchas gracias...

steeldragon-
Автор

it's very interesting, but can you tell me how to do GET and POST for MariaDB(MySQL) for a locale server ?

sahaskamble
Автор

Hye James thanks for the nice content. I have a question though:
- Is it advisable for the xata client to be called only once in dev environment like we do with prisma and export it from separate file? Or is it just for the nextjs hot reload?

alisontahiri
Автор

Great video.
I'm used to have a "services" folder though, where I put all of the logic to keep my controllers clean with almost just service imports and responses.
With this astro approach, where would you move this services folder to ? I assume it has to be outside of pages, so right into /src ?

Ownagin
Автор

Would you consider astro ready for a more dynamic app now? With api routes and middleware stable?

kylemelton
Автор

can you please say, which theme you are using?

ramimhossainantor
Автор

I appreciate the video, but maybe, you blind me with those white screens

Danielo
Автор

Nice topic but actual content… making CRUD on top of CRUD((( Nothing specific, no OpenAPI schemas, validations

VolodymyrMoon