update CORS middleware and make it configurable

This commit is contained in:
David Christofas
2021-10-21 15:46:48 +02:00
parent c370276198
commit 9ecc065879
29 changed files with 365 additions and 39 deletions
+9
View File
@@ -18,12 +18,21 @@ type Debug struct {
Zpages bool
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string
AllowedMethods []string
AllowedHeaders []string
AllowCredentials bool
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string
Namespace string
Root string
CacheTTL int
CORS CORS
}
// GRPC defines the available grpc configuration.