diff options
author | 2021-03-18 23:27:43 +0100 | |
---|---|---|
committer | 2021-03-18 23:27:43 +0100 | |
commit | 1b118841211da90381dd950cafa13ead78b7f589 (patch) | |
tree | fe89341206aa367b022ac778a932537e7f09763f /internal/api/server.go | |
parent | almost there (diff) | |
download | gotosocial-1b118841211da90381dd950cafa13ead78b7f589.tar.xz |
auth flow working for code
Diffstat (limited to 'internal/api/server.go')
-rw-r--r-- | internal/api/server.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/api/server.go b/internal/api/server.go index 321c932cd..8e22742bb 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -19,6 +19,10 @@ package api import ( + "fmt" + "os" + "path/filepath" + "github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions/memstore" "github.com/gin-gonic/gin" @@ -71,6 +75,10 @@ func New(config *config.Config, logger *logrus.Logger) Server { engine := gin.New() store := memstore.NewStore([]byte("authentication-key"), []byte("encryption-keyencryption-key----")) engine.Use(sessions.Sessions("gotosocial-session", store)) + cwd, _ := os.Getwd() + tmPath := filepath.Join(cwd, fmt.Sprintf("%s*", config.TemplateConfig.BaseDir)) + logger.Debugf("loading templates from %s", tmPath) + engine.LoadHTMLGlob(tmPath) return &server{ APIGroup: engine.Group("/api").Group("/v1"), logger: logger, |