started implementing a /ping route

This commit is contained in:
pb 2023-10-26 17:32:59 +02:00
parent 57c82dcfa4
commit de3a4a016e
2 changed files with 23 additions and 0 deletions

18
controllers/default.go Normal file
View File

@ -0,0 +1,18 @@
package controllers
import (
beego "github.com/beego/beego/v2/server/web"
)
// MainController is in charge of the main page
type MainController struct {
beego.Controller
}
// @Title logout
// @Description Logs out current logged in user session
// @Success 200 {string} logout success
// // @Security mySecurityPathNameApiKey
// @router /logout [get]

View File

@ -81,7 +81,12 @@ func Init() {
),
)
// Namespace containing useful Path such as ping
default_ns := beego.NewNamespace("/",beego.NSInclude(&controllers.MainController{}))
beego.AddNamespace(ns)
beego.AddNamespace(default_ns)
beego.Get("/", func(ctx *context.Context) {
ctx.Output.Body([]byte(services.DC_NAME))