Bun starter kit consists of:
- bunrouter is an extremely fast and flexible router.
- bun
- Hooks to initialize the app.
- CLI to run HTTP server and migrations, for example,
go run cmd/bun/*.go db help
. - example package that shows how to load fixtures and test handlers.
You can also check bun-realworld-app which is a JSON API built with Bun starter kit.
To start using this kit, clone the repo:
git clone https://github.com/go-bun/bun-starter-kit.git
Make sure you have correct information in app/config/test.yaml
and then run migrations (database
must exist before running):
go run cmd/bun/main.go -env=dev db init
go run cmd/bun/main.go -env=dev db migrate
To start the server:
go run cmd/bun/main.go -env=dev runserver
Then run the tests in example package:
cd example
go test
See documentation for more info.