gin sample done

This commit is contained in:
2024-02-21 12:55:52 -06:00
parent f5407bb15b
commit 1640e0d6ed
2 changed files with 14 additions and 2 deletions

BIN
go-crud

Binary file not shown.

16
main.go
View File

@@ -1,7 +1,19 @@
package main package main
import "fmt" import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() { func main() {
fmt.Println("Hello world 123") r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "pong",
})
})
r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
} }