Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add base path to ServerErrorResponse #112

Merged
merged 4 commits into from Feb 3, 2020

Conversation

@doertydoerk
Copy link
Contributor

doertydoerk commented Jan 31, 2020

No description provided.

doertydoerk and others added 2 commits Jan 31, 2020
The root path in my project is configurable via
flamingo.router.path: %%ENV:BASE_PATH%%/gateway/%%

My error pages are static HTML. So, if the above path changes all CSS and assets of my error pages won't be found anymore.
Having base available in the DataResponse would allow me to set the path "dynamically" in my static HMTL like so:

Considering all other options and given this is an edge case for a Flamingo environment, I find this to be the least invasive option to the problem.

Thanks for approving my request!
@doertydoerk doertydoerk requested a review from panzerfahrer Jan 31, 2020
Dirk Gerretz added 2 commits Jan 31, 2020
@panzerfahrer panzerfahrer merged commit 723fde7 into i-love-flamingo:master Feb 3, 2020
2 checks passed
2 checks passed
GolangCI No issues found!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bastianccm

This comment has been minimized.

Copy link
Contributor

bastianccm commented Feb 3, 2020

Why don't you use the url template function? It will handle the base path correctly already if the path starts with /.
https://github.com/i-love-flamingo/flamingo/blob/master/framework/web/router.go#L168

@bastianccm

This comment has been minimized.

Copy link
Contributor

bastianccm commented Feb 3, 2020

Also for the mocks we don't have a go:generate to regenerate the mocks, like here: https://github.com/i-love-flamingo/flamingo/blob/master/core/security/application/doc.go#L3

Are the mocks necessary anyway?

And please sort the imports in framework/web/result_test.go

@bastianccm

This comment has been minimized.

Copy link
Contributor

bastianccm commented Feb 4, 2020

Resolved by using url "/" template function. This will be reverted.

bastianccm added a commit that referenced this pull request Feb 4, 2020
This reverts commit 723fde7.
bastianccm added a commit that referenced this pull request Feb 4, 2020
This reverts commit 723fde7.
bastianccm added a commit that referenced this pull request Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.