refactor: enable cors - dev env + swagger is disabled by default
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
786cc60e38
commit
10cb5b83b1
|
@ -130,13 +130,13 @@ func newServer(cfg serverConfig) (*http.Server, error) {
|
|||
}
|
||||
|
||||
type apiConfig struct {
|
||||
SwaggerEnabled bool `envconfig:"SWAGGER_ENABLED" default:"true"`
|
||||
SwaggerEnabled bool `envconfig:"SWAGGER_ENABLED" default:"false"`
|
||||
SwaggerHost string `envconfig:"SWAGGER_HOST" default:""`
|
||||
SwaggerSchemes []string `envconfig:"SWAGGER_SCHEMES" default:"http,https"`
|
||||
CORSEnabled bool `envconfig:"CORS_ENABLED" default:"false"`
|
||||
CORSAllowedOrigins []string `envconfig:"CORS_ALLOWED_ORIGINS" default:""`
|
||||
CORSAllowCredentials bool `envconfig:"CORS_ALLOW_CREDENTIALS" default:"false"`
|
||||
CORSAllowedMethods []string `envconfig:"CORS_ALLOWED_METHODS" default:"HEAD,GET"`
|
||||
CORSAllowedMethods []string `envconfig:"CORS_ALLOWED_METHODS" default:"HEAD,GET,POST,PUT"`
|
||||
CORSMaxAge uint32 `envconfig:"CORS_MAX_AGE" default:"300"`
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ spec:
|
|||
- name: DB_MAX_IDLE_CONNECTIONS
|
||||
value: "5"
|
||||
- name: API_SWAGGER_ENABLED
|
||||
value: "true"
|
||||
value: "false"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /_meta/livez
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: sessions-api-deployment
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: sessions-api
|
||||
image: sessions
|
||||
env:
|
||||
- name: APP_MODE
|
||||
value: development
|
||||
- name: DB_DSN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: sessions-secret
|
||||
key: db-dsn
|
||||
- name: DB_MAX_OPEN_CONNECTIONS
|
||||
value: "10"
|
||||
- name: DB_MAX_IDLE_CONNECTIONS
|
||||
value: "5"
|
||||
- name: API_SWAGGER_ENABLED
|
||||
value: "true"
|
||||
- name: API_CORS_ENABLED
|
||||
value: "true"
|
||||
- name: API_CORS_ALLOWED_ORIGINS
|
||||
value: "*"
|
|
@ -4,3 +4,5 @@ nameSuffix: -dev
|
|||
resources:
|
||||
- secret.yml
|
||||
- ../../base
|
||||
patchesStrategicMerge:
|
||||
- api.yml
|
Loading…
Reference in New Issue