modified: main_dc/yalarba/api_yal/go.mod
modified: main_dc/yalarba/api_yal/go.sum modified: main_dc/yalarba/api_yal/internal/config/config.go modified: main_dc/yalarba/api_yal/internal/router/router.go add stock middleware from chi
This commit is contained in:
@@ -14,8 +14,16 @@ type Config struct {
|
||||
ServerPort string
|
||||
UploadPath string
|
||||
LogLevel string
|
||||
Environment string
|
||||
Environment string `yaml:"environment" env:"ENVIRONMENT" default:"development"`
|
||||
AppPort string
|
||||
CORS struct {
|
||||
AllowedOrigins []string `yaml:"allowed_origins" env:"CORS_ALLOWED_ORIGINS"`
|
||||
} `yaml:"cors"`
|
||||
|
||||
RateLimit struct {
|
||||
Enabled bool `yaml:"enabled" env:"RATE_LIMIT_ENABLED" default:"false"`
|
||||
RequestsPerSecond int `yaml:"requests_per_second" env:"RATE_LIMIT_REQUESTS" default:"100"`
|
||||
} `yaml:"rate_limit"`
|
||||
}
|
||||
|
||||
func Load() *Config {
|
||||
|
||||
Reference in New Issue
Block a user