Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 736 Bytes

README.md

File metadata and controls

16 lines (13 loc) · 736 Bytes

elysia-jwt-example

A tiny example that implements token based authentication in bun and elysia.

Inspirations from this blog post by Mihai-Adrian Andrei.

Try locally

  • 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 to file:./dev.db)
    • JWT_ACCESS_SECRET
    • JWT_REFRESH_SECRET
  • Run bun run dev to start the application.