feat(http): allow passing middlewares via options
All checks were successful
arcad/edge/pipeline/head This commit looks good

This commit is contained in:
2023-09-20 09:23:53 -06:00
parent 7e58551f6a
commit c3535a4a9b
3 changed files with 18 additions and 4 deletions

View File

@ -216,15 +216,17 @@ func runApp(ctx context.Context, path string, address string, storageFile string
authModule.WithJWT(dummyKeySet),
),
),
appHTTP.WithHTTPMiddlewares(
authModuleMiddleware.AnonymousUser(
jwa.HS256, key,
),
),
)
if err := handler.Load(bundle); err != nil {
return errors.Wrap(err, "could not load app bundle")
}
router := chi.NewRouter()
router.Use(authModuleMiddleware.AnonymousUser(
jwa.HS256, key,
))
router.Use(middleware.Logger)
router.Use(middleware.Compress(5))