初步搭建
This commit is contained in:
29
srv/cmd/gatekeeper/main.go
Normal file
29
srv/cmd/gatekeeper/main.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user