Closed damongolding closed 3 days ago
The changes introduce a new feature for handling URL redirects in the Immich Kiosk project. A section titled "Redirects" is added to the README.md
, detailing the configuration and examples of redirects. The KioskSettings
structure in config/config.go
is updated to include a new Redirect
type, along with fields for managing redirects. A new route handler is added in main.go
to process redirect requests, and a new file, routes/routes_redirect.go
, is created to define the logic for handling these redirects using the Echo framework.
File | Change Summary |
---|---|
README.md | Added new section "Redirects" with subsections "How they Work", "Configuration", and "Examples". |
config/config.go | Introduced new type Redirect , added fields Redirects (slice) and RedirectsMap (map) to KioskSettings , and updated Load method to process redirects. |
main.go | Added a new GET route /:redirect linked to routes.Redirect(baseConfig) . |
routes/routes_redirect.go | Created new file defining RedirectPath struct and Redirect function to handle URL redirections. |
sequenceDiagram
participant User
participant Kiosk
participant RedirectHandler
User->>Kiosk: GET /:redirect
Kiosk->>RedirectHandler: Process redirect
RedirectHandler->>RedirectHandler: Bind parameters
RedirectHandler->>RedirectHandler: Check RedirectsMap
alt Redirect found
RedirectHandler-->>User: HTTP 307 to URL
else Redirect not found
RedirectHandler-->>User: HTTP 307 to /
end
🐇 "In the Kiosk, paths now are neat,
Redirects make access a treat.
With a hop and a skip,
Users now zip,
To URLs short, oh so sweet!"
🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Documentation
Bug Fixes