A Golang framework for restful API. This repository demonstrates the usage of Restful API within a Golang application.
- go dep
$ go get -u github.com/golang/dep/cmd/dep
$ dep init -v
$ dep ensure -v
- Create .env file
$ make env-init
It will create .env file
APP_HOST=yourapphost
APP_DB_HOST=yourdbhost
APP_PORT=yourapphost
APP_VERSION=ypurappversion
DB_CONNECTION=yourdbdriver
DB_USERNAME=yourdatabaseuser
DB_DATABASE=yourdatabasename
DB_PASSWORD=yourdatabasepassword
DB_PORT=yourdatabaseport
go run main.go
- Set Local Path Project in makefile
$ vi makefile
set local path
$ LOCAL_DESTINATION=/home/golang/src/restgo_framework/
- Build image and run application
$ make build
$ make run
- start|restart|stop program
$ make start
$ make restart
$ make stop
Required | Key | Value |
---|---|---|
Yes | Content-Type | application/x-www-form-urlencoded |
- env configuration
- Controller based
- Route based
- Model based
- Helper JSON format