started implementing a /ping route
This commit is contained in:
parent
57c82dcfa4
commit
de3a4a016e
18
controllers/default.go
Normal file
18
controllers/default.go
Normal 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]
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user