mirror of
https://github.com/FJurmanovic/sugarr.git
synced 2026-11-11 15:51:09 +00:00
trigger endpoint and retry suggestions
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/fjurmanovic/sugarr/internal/api"
|
||||
"github.com/fjurmanovic/sugarr/internal/service"
|
||||
"github.com/fjurmanovic/sugarr/internal/utl/configs"
|
||||
"github.com/fjurmanovic/sugarr/internal/utl/httputil"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
@@ -17,5 +18,8 @@ func Start(cfg *configs.Config, rec *service.Recommender) error {
|
||||
|
||||
addr := fmt.Sprintf(":%d", cfg.APIPort)
|
||||
log.Info().Msgf("HTTP API listening on %s", addr)
|
||||
return http.ListenAndServe(addr, mux)
|
||||
if cfg.APISecretKey != "" {
|
||||
log.Info().Msg("Secret key auth enabled")
|
||||
}
|
||||
return http.ListenAndServe(addr, httputil.AuthMiddleware(cfg.APISecretKey, mux))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user