Welcome to the Bun Server Template! This repository uses Bun to create an HTTP server and MongoDB as the primary database. It leverages decorators to define endpoints in a clean and structured way.
Feel free to star the project and contribute by reporting or fixing any issues. 😊
Clone project:
git clone git@github.com:mojtaba-7/bun-server-template.git
Go to the directory:
cd ./bun-server-template
Configure enviroment variables
cp .env.example .env
- Enter log file address APP_LOG_FILE"
- Put MONGODB_URI, MONGODB_USERNAME, MONGODB_PASSWORD based on your approach
To install dependencies:
bun install
To run:
bun run start
Run as development mode:
bun run dev
Run Tests:
bun run test-all
To create an user:
bun create-user
- use decorators to define your endpints
- don't use any type at all
This project was created using bun init
in bun v1.1.25. Bun is a fast all-in-one JavaScript runtime.