elysia-jwt-example

JWT token based authentication API endpoints in Elysia.js, a web framework for Bun.js

MIT License

Stars
10
Committers
1

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.