Ai
1 Star 0 Fork 0

ff/hello-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 383 Bytes
一键复制 编辑 原始数据 按行查看 历史
FF 提交于 2024-04-07 16:15 +08:00 . init
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "Hello, World!",
})
})
r.GET("/ping", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "pong",
})
})
r.Run(":3000") // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ft/hello-go.git
git@gitee.com:ft/hello-go.git
ft
hello-go
hello-go
main

搜索帮助