diff --git a/routers/kanban/kanban.go b/routers/kanban/kanban.go new file mode 100644 index 000000000..d6bb743bb --- /dev/null +++ b/routers/kanban/kanban.go @@ -0,0 +1,24 @@ +package kanban + +import ( + "code.gitea.io/gitea/modules/base" + "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/setting" + "net/http" + "os" + "path" + "time" +) + +func Index(ctx *context.Context) { + file := path.Join(setting.StaticRootPath, "public/kanban/index.html") + name := "index.html" + f, err := os.Open(file) + if err != nil { + ctx.HTML(http.StatusNotFound, base.TplName("status/404")) + return + } + defer f.Close() + ctx.Resp.Header().Set("Content-Type", "text/html") + http.ServeContent(ctx.Resp, ctx.Req.Request, name, time.Now(), f) +} diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 35a26f585..bdad93572 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -6,6 +6,7 @@ package routes import ( "bytes" + "code.gitea.io/gitea/routers/kanban" "encoding/gob" "net/http" "path" @@ -327,6 +328,7 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Get("/", routers.Home) m.Get("/dashboard", routers.Dashboard) + m.Get("/kanban/index", kanban.Index) go routers.SocketManager.Run() m.Get("/action/notification", routers.ActionNotification) m.Get("/recommend/home", routers.RecommendHomeInfo)