mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
23 lines
572 B
Go
23 lines
572 B
Go
package controllers
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/astaxie/beego"
|
|
)
|
|
|
|
type MainController struct{ beego.Controller }
|
|
|
|
func (c *MainController) Get() {
|
|
c.Ctx.Redirect(302, "/static/Jamstash/")
|
|
}
|
|
|
|
func (c *MainController) Error404() {
|
|
if beego.BConfig.RunMode != beego.PROD || beego.BConfig.Log.AccessLogs {
|
|
r := c.Ctx.Request
|
|
devInfo := fmt.Sprintf("| %-10s | %-40s | %-16s", r.Method, r.URL.Path, r.URL.RawQuery)
|
|
if beego.DefaultAccessLogFilter == nil || !beego.DefaultAccessLogFilter.Filter(c.Ctx) {
|
|
beego.Warn(devInfo)
|
|
}
|
|
}
|
|
c.CustomAbort(404, "Error 404")
|
|
}
|