A tiny example that implements token based authentication in bun and elysia.
Inspirations from this blog post by Mihai-Adrian Andrei.
- Install bun.
- Clone this repository.
- Run
bun i
to install the necessary packages. - Run
bunx prisma generate
to initialize the sqlite database from the prisma schema file. - Set environment variables
DATABASE_URL
(since I used sqlite this was set tofile:./dev.db
)JWT_ACCESS_SECRET
JWT_REFRESH_SECRET
- Run
bun run dev
to start the application.