refactor(ws): ws logging and channel manager added no auth currently
This commit is contained in:
@@ -25,8 +25,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/joho/godotenv"
|
||||
"lst.net/cmd/services/system/config"
|
||||
socketio "lst.net/cmd/services/websocket"
|
||||
"lst.net/cmd/services/websocket"
|
||||
|
||||
_ "lst.net/docs"
|
||||
|
||||
"lst.net/utils/db"
|
||||
logging "lst.net/utils/logger"
|
||||
)
|
||||
@@ -42,7 +44,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Initialize DB
|
||||
if err := db.InitDB(); err != nil {
|
||||
if _, err := db.InitDB(); err != nil {
|
||||
log.Panic("Database intialize failed", "db", map[string]interface{}{
|
||||
"error": err.Error(),
|
||||
"casue": errors.Unwrap(err),
|
||||
@@ -112,7 +114,7 @@ func main() {
|
||||
})
|
||||
|
||||
//logging.RegisterLoggerRoutes(r, basePath)
|
||||
socketio.RegisterSocketRoutes(r)
|
||||
websocket.RegisterSocketRoutes(r)
|
||||
config.RegisterConfigRoutes(r, basePath)
|
||||
|
||||
r.Any(basePath+"/api", errorApiLoc)
|
||||
@@ -136,7 +138,7 @@ func main() {
|
||||
// }
|
||||
func errorApiLoc(c *gin.Context) {
|
||||
log := logging.New()
|
||||
log.Info("Api endpoint hit that dose not exist", "system", map[string]interface{}{
|
||||
log.Error("Api endpoint hit that dose not exist", "system", map[string]interface{}{
|
||||
"endpoint": "/api",
|
||||
"client_ip": c.ClientIP(),
|
||||
"user_agent": c.Request.UserAgent(),
|
||||
|
||||
Reference in New Issue
Block a user