This commit is contained in:
parent
8862ac15b0
commit
e068b4740c
@ -6,6 +6,9 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
|
||||
"git.paulbsd.com/paulbsd/ipbl/src/config"
|
||||
"git.paulbsd.com/paulbsd/ipbl/src/database"
|
||||
"git.paulbsd.com/paulbsd/ipbl/src/models"
|
||||
@ -37,6 +40,12 @@ func main() {
|
||||
go models.ScanIP(&cfg)
|
||||
}
|
||||
|
||||
if cfg.Switchs.Debug {
|
||||
go func() {
|
||||
log.Println(http.ListenAndServe("localhost:6060", nil))
|
||||
}()
|
||||
}
|
||||
|
||||
ws.Init(&cfg)
|
||||
go func() { err = routers.RunServer(&ctx, &cfg) }()
|
||||
if err != nil {
|
||||
|
@ -15,11 +15,14 @@ import (
|
||||
|
||||
func RegisterRoutes(e *echo.Echo, ctx *context.Context, cfg *config.Config) {
|
||||
e.GET("/", func(c echo.Context) error {
|
||||
return c.HTML(http.StatusOK, `<html>
|
||||
<body>
|
||||
<p>Welcome to ipbl software (<a href="https://git.paulbsd.com/paulbsd/ipbl">https://git.paulbsd.com/paulbsd/ipbl</a>)</p>
|
||||
</body>
|
||||
</html>`)
|
||||
return c.HTML(http.StatusOK, `
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<p>Welcome to ipbl software (<a href="https://git.paulbsd.com/paulbsd/ipbl">https://git.paulbsd.com/paulbsd/ipbl</a>)</p>
|
||||
</body>
|
||||
</html>
|
||||
`)
|
||||
})
|
||||
|
||||
e.GET("/health", func(c echo.Context) error {
|
||||
|
Loading…
Reference in New Issue
Block a user