23 lines
427 B
Go
23 lines
427 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"fmt"
|
|
)
|
|
|
|
//go:generate go env -w GO111MODULE=on
|
|
//go:generate go env -w GOPROXY=https://goproxy.cn,direct
|
|
//go:generate go mod tidy
|
|
//go:generate go mod download
|
|
|
|
func main() {
|
|
router := gin.Default()
|
|
router.GET("/", func(c *gin.Context) {
|
|
Q := c.Query("q")
|
|
c.JSON(200, gin.H{
|
|
"message": "Hello "+Q,
|
|
})
|
|
fmt.Println("Hello "+Q+"……")
|
|
})
|
|
router.Run(":8080")
|
|
} |