🐛 Fetch timeline from the ticker's own /api instead of a dedicated API host - #71
Merged
Merged
Conversation
… API host The ticker API no longer runs on its own hostname; it is served relative to each ticker at /api, which the reverse proxy rewrites to /v1. Fetch the timeline from the ticker's own origin instead of the removed ticker-api.systemli.org host, and drop the now-unused apiUrl prop. Attachment URLs returned by the API are host-relative too, so resolve them against origin before rendering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
The ticker API no longer runs on a dedicated hostname (
ticker-api.systemli.org). As of systemli/ticker#472, every ticker serves its own API relative to itself at/api, which the reverse proxy rewrites to/v1. See https://systemli.github.io/ticker/installation/.What changes
${origin}/api/timelineinstead of${apiUrl}/v1/timeline?origin=${origin}. The reverse proxy sets theOriginheader itself, so theoriginquery parameter is no longer needed.apiUrlprop is removed; there is no longer a separate API host to point it at./api/media/<file>). They are now resolved againstoriginbefore being used asimg src, otherwise they'd resolve against whatever page embeds the widget.geoInformationfrom theMessagetype, as the API response no longer contains it.Breaking changes
apiUrlprop /api-urlattribute is gone. Existing embeds that only setoriginare unaffected.Related