Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/go-spring/starter-gin
「仅发布」gin 启动器 ( starter for gin )
https://github.com/go-spring/starter-gin
gin go-spring web
Last synced: 1 day ago
JSON representation
「仅发布」gin 启动器 ( starter for gin )
- Host: GitHub
- URL: https://github.com/go-spring/starter-gin
- Owner: go-spring
- License: apache-2.0
- Created: 2020-08-08T10:27:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-09T09:39:22.000Z (about 2 years ago)
- Last Synced: 2023-07-27T22:10:24.690Z (over 1 year ago)
- Topics: gin, go-spring, web
- Language: Go
- Homepage: https://go-spring.com
- Size: 1.8 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# starter-gin
[English](README_EN.md)
[仅发布] 该项目仅为最终发布,不要向该项目直接提交代码,开发请关注 [go-spring](https://github.com/go-spring/go-spring) 项目。
## Install
### Prerequisites
- Go >= 1.12
### Using go get
```
go get github.com/go-spring/[email protected]
```## Quick Start
```
import _ "github.com/go-spring/starter-gin"
````main.go`
```
package mainimport (
"fmt""github.com/go-spring/spring-core/gs"
"github.com/go-spring/spring-core/web"
_ "github.com/go-spring/starter-gin"
)func init() {
gs.Object(new(Controller)).Init(func(c *Controller) {
gs.GetMapping("/", c.Hello)
})
}type Controller struct {
GOPATH string `value:"${GOPATH}"`
}func (c *Controller) Hello(ctx web.Context) {
ctx.String("%s - hello world!", c.GOPATH)
}func main() {
fmt.Println(gs.Run())
}
````config/application.properties`
```
web.server.port=8000
``````
➜ curl http://localhost:8000/
/Users/didi/work - hello world!
```## Customization