A Bun-based API project using Elysia and Bun's native PostgreSQL driver.
- Bun 1.2.8 or later
- PostgreSQL database
Create a .env file in the root directory with the following variables:
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=api- Install dependencies:
bun install- Run migrations:
bun run migrate- Start the development server:
bun run devOnce the server is running, you can access the Swagger documentation at:
http://localhost:3000/swagger
GET /- Hello WorldGET /users- Get all usersPOST /users- Create a new user
The project uses:
- Bun's native SQL driver for PostgreSQL
- Elysia for the web framework
- Swagger for API documentation
- CORS for cross-origin requests