@@ -16,7 +16,23 @@ When dealing with many routes, maintaining them in one file can quickly become u
|
|||||||
|
|
||||||
Example of an extra route
|
Example of an extra route
|
||||||
|
|
||||||
Create a file using `yaml` or `.yaml` extensions
|
Defined an extra route path in `gateway` section as shown below.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: 1.0
|
||||||
|
gateway:
|
||||||
|
...
|
||||||
|
## Add additional routes
|
||||||
|
extraRoutes:
|
||||||
|
# path
|
||||||
|
directory: /etc/goma/extra
|
||||||
|
watch: false
|
||||||
|
routes:
|
||||||
|
- path: /
|
||||||
|
name: example
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a file in `/etc/goma/extra` using `yaml` or `.yaml` extension.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
routes:
|
routes:
|
||||||
|
|||||||
@@ -64,11 +64,6 @@ gateway:
|
|||||||
accessLog: /dev/Stdout
|
accessLog: /dev/Stdout
|
||||||
errorLog: /dev/stderr
|
errorLog: /dev/stderr
|
||||||
logLevel: info
|
logLevel: info
|
||||||
## Add additional routes
|
|
||||||
extraRoutes:
|
|
||||||
# path
|
|
||||||
directory: /etc/goma/extra
|
|
||||||
watch: true
|
|
||||||
disableRouteHealthCheckError: false
|
disableRouteHealthCheckError: false
|
||||||
disableDisplayRouteOnStart: false
|
disableDisplayRouteOnStart: false
|
||||||
disableKeepAlive: false
|
disableKeepAlive: false
|
||||||
@@ -85,5 +80,10 @@ gateway:
|
|||||||
Access-Control-Allow-Credentials: "true"
|
Access-Control-Allow-Credentials: "true"
|
||||||
Access-Control-Allow-Headers: Origin, Authorization, Accept, Content-Type, Access-Control-Allow-Headers, X-Client-Id, X-Session-Id
|
Access-Control-Allow-Headers: Origin, Authorization, Accept, Content-Type, Access-Control-Allow-Headers, X-Client-Id, X-Session-Id
|
||||||
Access-Control-Max-Age: "1728000"
|
Access-Control-Max-Age: "1728000"
|
||||||
|
## Add additional routes
|
||||||
|
extraRoutes:
|
||||||
|
# path
|
||||||
|
directory: /etc/goma/extra
|
||||||
|
watch: true
|
||||||
routes: []
|
routes: []
|
||||||
```
|
```
|
||||||
@@ -34,11 +34,11 @@ type Gateway struct {
|
|||||||
// RateLimit Defines the number of request peer minutes
|
// RateLimit Defines the number of request peer minutes
|
||||||
RateLimit int `yaml:"rateLimit" env:"GOMA_RATE_LIMIT, overwrite"`
|
RateLimit int `yaml:"rateLimit" env:"GOMA_RATE_LIMIT, overwrite"`
|
||||||
// BlockCommonExploits enable, disable block common exploits
|
// BlockCommonExploits enable, disable block common exploits
|
||||||
BlockCommonExploits bool `yaml:"blockCommonExploits"`
|
BlockCommonExploits bool `yaml:"blockCommonExploits"`
|
||||||
AccessLog string `yaml:"accessLog" env:"GOMA_ACCESS_LOG, overwrite"`
|
AccessLog string `yaml:"accessLog" env:"GOMA_ACCESS_LOG, overwrite"`
|
||||||
ErrorLog string `yaml:"errorLog" env:"GOMA_ERROR_LOG=, overwrite"`
|
ErrorLog string `yaml:"errorLog" env:"GOMA_ERROR_LOG=, overwrite"`
|
||||||
LogLevel string `yaml:"logLevel" env:"GOMA_LOG_LEVEL, overwrite"`
|
LogLevel string `yaml:"logLevel" env:"GOMA_LOG_LEVEL, overwrite"`
|
||||||
ExtraRoutes ExtraRouteConfig `yaml:"extraRoutes"`
|
|
||||||
// DisableHealthCheckStatus enable and disable routes health check
|
// DisableHealthCheckStatus enable and disable routes health check
|
||||||
DisableHealthCheckStatus bool `yaml:"disableHealthCheckStatus"`
|
DisableHealthCheckStatus bool `yaml:"disableHealthCheckStatus"`
|
||||||
// DisableRouteHealthCheckError allows enabling and disabling backend healthcheck errors
|
// DisableRouteHealthCheckError allows enabling and disabling backend healthcheck errors
|
||||||
@@ -52,7 +52,8 @@ type Gateway struct {
|
|||||||
InterceptErrors []int `yaml:"interceptErrors"`
|
InterceptErrors []int `yaml:"interceptErrors"`
|
||||||
// Cors holds proxy global cors
|
// Cors holds proxy global cors
|
||||||
Cors Cors `yaml:"cors"`
|
Cors Cors `yaml:"cors"`
|
||||||
|
// ExtraRoutes additional routes from defined directory
|
||||||
|
ExtraRoutes ExtraRouteConfig `yaml:"extraRoutes"`
|
||||||
// Routes holds proxy routes
|
// Routes holds proxy routes
|
||||||
Routes []Route `yaml:"routes"`
|
Routes []Route `yaml:"routes"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user