Let’s build a REST API with Bun, Prisma and Elysia
pozy
0:00 / 0:00
Let’s build a REST API with Bun, Prisma and Elysia
24 283 просмотра · 3 г. назад
pozy
1,3 тыс. подписчиков
24 283 просмотра · 3 г. назад
Bun is amazing! Building apps that use NPM dependencies is pretty hit or miss with it though.
For this video i set out to build a REST API that uses Prisma, Elysia and Swagger UI so that i can figure out how hard or easy it is to set this up. Hope you'll enjoy this journey.
🔗 Links
Bun - https://bun.sh/
Elysia - https://elysiajs.com/quick-start.html
Prisma - https://www.prisma.io/docs/getting-st...
Prisma Data Proxy - https://www.prisma.io/docs/data-platf...
Planetscale. - https://planetscale.com/
Full code - https://github.com/pozymasika/bun-pri...
00:00 - Introduction
00:32 - What we will build
00:43 - Install Bun, Elysia and VSCode REST Client
01:27 - Setup API Routes
02:35 - Elysia route groups
03:07 - Elysia schema guards
03:46 - Database setup (Prisma)
04:07 - PlanetScale database setup
04:42 - Shadow database error!
05:28 - Setup Models
06:50 - Foreign keys don't work on PlanetScale!
08:36 - Prisma seed script doesn work!
09:14 - Connect Prisma to Elysia
10:02 - Database querying doesn't work with Elysia!
10:22 - Switching to Prisma Data Proxy fixes prisma?
13:35 - Add swagger UI
14:09 - Final thoughts