feat: add limit HTTP methods allowed for a particular route

This commit is contained in:
2024-11-08 22:58:09 +01:00
parent 87bb8f9f99
commit d24625496f
9 changed files with 39 additions and 156 deletions

View File

@@ -10,7 +10,7 @@ Goma Gateway is a lightweight API Gateway Management.
<img src="https://raw.githubusercontent.com/jkaninda/goma-gateway/main/logo.png" width="150" alt="Goma logo">
It comes with a lot of integrated features, such as:
It's designed to be straightforward and efficient, offering features, like:
- RESTFull API Gateway management
- Domain/host based request routing
@@ -31,6 +31,8 @@ It comes with a lot of integrated features, such as:
- Rate limiting
- In-Memory Token Bucket based
- In-Memory client IP based
- Limit HTTP methods allowed for a particular route.
Declare your routes and middlewares as code.

View File

@@ -223,6 +223,7 @@ Example of rateLimit middleware
path: /protected
rewrite: /
destination: 'https://example.com'
methods: [POST, PUT, GET]
healthCheck:
cors: {}
middlewares:

View File

@@ -16,6 +16,7 @@ The Route allows you to match on HTTP traffic and direct it to the backend.
path: /store/cart
rewrite: /cart
destination: http://cart-service:8080
methods: [POST, PUT, GET]
healthCheck: ''
cors: {}
middlewares:
@@ -39,7 +40,7 @@ gateway:
## SSL Private Key file
sslKeyFile: ''#key.pem
# Proxy rate limit, it's In-Memory IP based
rateLimiter: 0
rateLimit: 0
accessLog: "/dev/Stdout"
errorLog: "/dev/stderr"
## Enable, disable routes health check
@@ -77,6 +78,7 @@ gateway:
# e.g rewrite: /store to /
rewrite: /
destination: https://example.com
methods: [GET]
#DisableHeaderXForward Disable X-forwarded header.
# [X-Forwarded-Host, X-Forwarded-For, Host, Scheme ]
# It will not match the backend route, by default, it's disabled