updated ipbl
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2023-09-10 20:36:57 +02:00
parent 8862ac15b0
commit e068b4740c
2 changed files with 17 additions and 5 deletions

View File

@ -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 {

View File

@ -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>
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>`)
</html>
`)
})
e.GET("/health", func(c echo.Context) error {