初步搭建

This commit is contained in:
des
2026-01-13 00:08:49 +08:00
parent d7854bbf1d
commit 0c68d57180
7 changed files with 114 additions and 14 deletions

View File

@@ -0,0 +1,29 @@
package main
import (
"fmt"
"net/http"
"github.com/labstack/echo"
"Crimson-Gatekeeper/internal/common"
)
func main() {
client := common.GetDataBaseClient()
config, ero := client.DB()
if ero != nil {
fmt.Println("获取连接池失败")
panic(ero)
}
defer config.Close()
app := echo.New()
app.GET("/", func(ctx echo.Context) error {
return ctx.String(http.StatusOK, "Hello, World!")
})
app.Logger.Fatal(app.Start(":8443"))
defer app.Close()
}