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