go-run/main.go

23 lines
427 B
Go
Raw Normal View History

2024-07-06 21:36:40 +08:00
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) {
2024-07-07 20:58:49 +08:00
Q := c.Query("q")
2024-07-06 21:36:40 +08:00
c.JSON(200, gin.H{
"message": "Hello "+Q,
})
2024-07-13 19:32:44 +08:00
fmt.Println("Hello "+Q+"……")
2024-07-06 21:36:40 +08:00
})
router.Run(":8080")
}