feat: hello world

This commit is contained in:
Muyao CHEN
2024-09-30 22:42:07 +02:00
parent 67ce9adf69
commit 6625b60baf
3 changed files with 144 additions and 0 deletions

24
cmd/howmuch/main.go Normal file
View File

@ -0,0 +1,24 @@
package main
import (
"fmt"
"net/http"
"github.com/gin-gonic/gin"
)
const port = 8080
func main() {
fmt.Println("How much do I owe you?")
r := gin.Default()
r.GET("/", func(ctx *gin.Context) {
ctx.JSON(http.StatusOK, gin.H{
"message": "how much?",
})
})
r.Run(fmt.Sprintf(":%d", port))
}