finish up translations and setup doc server stuff
This commit is contained in:
@ -3,30 +3,11 @@ package routes
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/ngn13/website/api/config"
|
||||
"github.com/ngn13/website/api/util"
|
||||
)
|
||||
|
||||
func GET_Index(c *fiber.Ctx) error {
|
||||
var (
|
||||
md []byte
|
||||
err error
|
||||
)
|
||||
|
||||
conf := c.Locals("config").(*config.Type)
|
||||
doc := conf.GetURL("doc_url")
|
||||
|
||||
if !conf.GetBool("index") {
|
||||
return util.ErrNotFound(c)
|
||||
}
|
||||
|
||||
frontend := conf.GetURL("frontend_url")
|
||||
api := conf.GetURL("api_url")
|
||||
|
||||
if md, err = util.Render("views/index.md", fiber.Map{
|
||||
"frontend": frontend,
|
||||
"api": api,
|
||||
}); err != nil {
|
||||
return util.ErrInternal(c, err)
|
||||
}
|
||||
|
||||
return util.Markdown(c, md)
|
||||
return c.Redirect(doc.JoinPath("/api").String())
|
||||
}
|
||||
|
Reference in New Issue
Block a user