mirror of
https://github.com/ZSCNetSupportDept/scheduler.git
synced 2025-10-28 12:35:03 +08:00
34 lines
571 B
Go
34 lines
571 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/labstack/echo/v4"
|
|
"html/template"
|
|
"zsxyww.com/scheduler/config"
|
|
"zsxyww.com/scheduler/database"
|
|
"zsxyww.com/scheduler/route"
|
|
"zsxyww.com/scheduler/tl"
|
|
)
|
|
|
|
func main() {
|
|
|
|
config.Load()
|
|
db.Connect()
|
|
|
|
app := echo.New()
|
|
register(app)
|
|
|
|
listenAddress := fmt.Sprintf(":%d", config.ListenPort)
|
|
|
|
app.Logger.Fatal(app.Start(listenAddress))
|
|
}
|
|
func register(app *echo.Echo) {
|
|
route.Route(app)
|
|
route.Middleware(app)
|
|
renderer := tl.tlw{
|
|
Tl: template.Must(template.ParseGlob("templates/*.html")),
|
|
}
|
|
app.Renderer = renderer
|
|
|
|
}
|