Allow overriding base path for UI/API routes; rm --query.prefix#748
Allow overriding base path for UI/API routes; rm --query.prefix#748yurishkuro merged 7 commits intomasterfrom
Conversation
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <meta charset="UTF-8"> | ||
| <base href="/" data-inject-target="BASE_URL"/> |
There was a problem hiding this comment.
@tiffon this models the compiled index.html from UI assets.
Q: is it possible that babel/webpack would reorder the href and data-inject-target attributes? Because if it does, the search&replace in the query service won't work
There was a problem hiding this comment.
@yurishkuro It should not change the order of the attributes.
jpkrohling
left a comment
There was a problem hiding this comment.
LGTM, but would be awesome to have the user notified when the HTML on disk is not what is being served to clients. Also, it would perhaps be worth adding some piece of documentation about this (when to use/why/how)
| options.BasePath = "/" | ||
| } | ||
| if options.BasePath != "/" { | ||
| if !strings.HasPrefix(options.BasePath, "/") || strings.HasSuffix(options.BasePath, "/") { |
There was a problem hiding this comment.
Is it possible to add a log statement notifying that what people see in the HTML is not what will be served to clients?
There was a problem hiding this comment.
could you elaborate why you think this would be useful? We're modifying the internal file of the app, not something that users provide.
There was a problem hiding this comment.
Mainly because it's deviating from what is "expected": if I had a problem with the static resources (like the original problem this PR is solving) and were to check the HTML, I would wonder why it's not the same as what my browser is seeing. A log entry at debug level would suffice, IMO.
There was a problem hiding this comment.
well, still not convinced why someone needs to know what happens internally, e.g. we also override the config, and in both cases we only do that when requested via cli arguments.
Let's do it separately, because the constructor doesn't take a logger and the unit tests explicitly verify that nothing is logged, so it's not as trivial a change as it sounds for a feature that seems rather marginal.
|
Docs would be updated in a separate PR in the docs repo. |
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
90f4635 to
7a019df
Compare
Resolves #745 Provide a means to define a path-prefix for the UI
Resolves #746 Remove --query.prefix option