Learn how to set up a starter Bun Rest API app from scratch that uses:
- Database
- Controllers
- Hooks (Error Handling & Logging)
- Guards
- Security (CORS, JWT, Helmet, Rate Limiter)
- Tests
📁 src
|__ 📁 controllers
| ├── static-data.controller.ts
| |__ users.controller.ts
|__ 📁 database
| |__ db.setup.ts
|__ 📁 entities
| |__ user.schema.ts
|__ 📁 startup
| ├── docs.ts
| ├── hooks.ts
| |__ security.ts
📁 test
|__ users.test.ts
.env
package.json
- Clone repository
- Install dependencies
bun i
- Create
.env
file - Paste database connections
- Have fun!
Development
> bun dev
Test
> bun test
Production
> bun start
- Bun: v1.0
- Elysia: v0.6