summaryrefslogtreecommitdiffstats
path: root/routers/home.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-05-02 15:35:59 +0200
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-05-02 15:35:59 +0200
commit3edb0c58943c003ed3f209b2197d1f43484a3432 (patch)
treee5849cead5053ab505a2c5dc1342111c6bcf0816 /routers/home.go
parentbb5f694fc57c3ade9c13e841b9a237f4e192da22 (diff)
downloadgitea-3edb0c58943c003ed3f209b2197d1f43484a3432.tar.gz
gitea-3edb0c58943c003ed3f209b2197d1f43484a3432.zip
Generate swagger json (#1402)
- Generate swagger.json into public/ - Add swagger-ui auto-installation - Add footer link to local swagger-ui - Add /swagger url for using app url. - Fix Swagger-UI version via git tag
Diffstat (limited to 'routers/home.go')
-rw-r--r--routers/home.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/home.go b/routers/home.go
index c02bd813fa..0f7b214627 100644
--- a/routers/home.go
+++ b/routers/home.go
@@ -20,6 +20,8 @@ import (
const (
// tplHome home page template
tplHome base.TplName = "home"
+ // tplSwagger swagger page template
+ tplSwagger base.TplName = "swagger"
// tplExploreRepos explore repositories page template
tplExploreRepos base.TplName = "explore/repos"
// tplExploreUsers explore users page template
@@ -51,6 +53,11 @@ func Home(ctx *context.Context) {
ctx.HTML(200, tplHome)
}
+// Swagger render swagger-ui page
+func Swagger(ctx *context.Context) {
+ ctx.HTML(200, tplSwagger)
+}
+
// RepoSearchOptions when calling search repositories
type RepoSearchOptions struct {
Ranger func(*models.SearchRepoOptions) (models.RepositoryList, int64, error)