Server toolkit - minimal and simple framework for developing server in golang
STK provides a suite of tools tailored for building and managing server applications.
with go install
go install github.com/adharshmk96/stk@latest
If installation fails, check the GOPATH and GOBIN environment variables. Make sure that GOBIN is added to your PATH.
echo export PATH=$PATH:$(go env GOPATH)/bin >> ~/.zshrc
source ~/.zshrc
or
echo export PATH=$PATH:$(go env GOPATH)/bin >> ~/.bashrc
source ~/.bashrc
stk init
make run
it will run go run . serve -p 8080
command
curl http://localhost:8080/api/ping
Checkout the full documentation here
Generate migration files ( optinally name it and fill )
stk migrator generate -n "initial migration" --fill
migrate up ( applies all migrations, or specified number of steps )
stk migrator up
migrate down ( applies all down migrations, or specified number of steps )
stk migrator down
History - Shows history of applied migrations
stk migrator history