GZIP: Enable compression before API routes are registered #4018
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
526867347a
commit
d98a1cb2ab
1 changed files with 6 additions and 6 deletions
|
@ -44,12 +44,6 @@ func Start(ctx context.Context, conf *config.Config) {
|
|||
// Register common middleware.
|
||||
router.Use(Recovery(), Security(conf), Logger())
|
||||
|
||||
// Create REST API router group.
|
||||
APIv1 = router.Group(conf.BaseUri(config.ApiUri), Api(conf))
|
||||
|
||||
// Initialize package extensions.
|
||||
Ext().Init(router, conf)
|
||||
|
||||
// Enable HTTP compression?
|
||||
switch conf.HttpCompression() {
|
||||
case "gzip":
|
||||
|
@ -66,6 +60,12 @@ func Start(ctx context.Context, conf *config.Config) {
|
|||
log.Infof("server: enabled gzip compression")
|
||||
}
|
||||
|
||||
// Create REST API router group.
|
||||
APIv1 = router.Group(conf.BaseUri(config.ApiUri), Api(conf))
|
||||
|
||||
// Initialize package extensions.
|
||||
Ext().Init(router, conf)
|
||||
|
||||
// Find and load templates.
|
||||
router.LoadHTMLFiles(conf.TemplateFiles()...)
|
||||
|
||||
|
|
Loading…
Reference in a new issue