Skip to content

Commit

Permalink
feat: add support for max body size
Browse files Browse the repository at this point in the history
  • Loading branch information
123FLO321 committed Dec 13, 2021
1 parent 81a5223 commit 9f7af76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/SwiftTileserverCache/routes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ func routes(_ app: Application) throws {
)
})

if let maxBodySize = Environment.get("MAX_BODY_SIZE") {
app.routes.defaultMaxBodySize = ByteCount(stringLiteral: maxBodySize)
}

let statsController = StatsController(tileServerURL: tileServerURL, tiles: tiles, fileToucher: FileToucher())
app.get(use: statsController.get)
app.get("styles", use: statsController.getStyles)
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ services:
MARKER_CACHE_DELAY_SECONDS: 3600 # 1 Hour
TEMPLATES_CACHE_DELAY_SECONDS: 60 # 1 Minute
# TILE_URL_MAPBOX_SATTELITE: https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}{@scale}.{format}?access_token=xxx
# MAX_BODY_SIZE: 1mb
ports:
- 9000:9000

0 comments on commit 9f7af76

Please sign in to comment.