-
Notifications
You must be signed in to change notification settings - Fork 395
Blog post about Angular and Quarkus development. #223
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
Conversation
@emmanuelbernard new version of Kabir's blog post |
==== Set up the Angular proxy | ||
We configure the proxy in https://github.com/kabir/blog-quarkus-ui-development/blob/master/webapp/proxy.conf.json[proxy.conf.json]. All REST calls to anything under `/api` will be passed to the back-end running on port 8080. To run the Angular development server with this configuration, we have added a `proxy` configuration to the `scripts` section of https://github.com/kabir/blog-quarkus-ui-development/blob/master/webapp/package.json[`package.json`]. | ||
|
||
In our case, we have a servlet which needs to redirect back to the front-end (something I found I needed to implement OAuth in my main project). That has a check for the `-Dui.proxy` system property we saw earlier when handling the `/callback` path in https://github.com/kabir/blog-quarkus-ui-development/blob/master/src/main/java/org/kabir/quarkus/ui/SampleServlet.java[`SampleServlet`]. If this property is set, we prepend `https://localhost:4200` (the address of the Angular proxy) to the redirect URL if we find the proxy is running on port 4200. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you don't read the ui.* properties via the @Inject @ConfigProperty
? That way you coudl read them via applciation.properties, system properties and enviornment properties equally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I did not understnand why this servlet was only answering to /servlet/
and not everything. As you can see I'm still a bit lost on the app flow exchange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, just to keep it simple (as well as being slightly ignorant of MP config). We only ever want this to be triggered via development mode though, it should never be used in production.
Hey @kabir I made some comments but I don't want to block you on it if you feel you've spent enough time on it. So it's up to you if you want to refine another time to just go for it. |
Make parts of the language more 'active'. Flesh out why the filter is needed. Other improvements from rereading.
@emmanuelbernard I have updated it. Unless my latest changes introduced something weird you pick up on, it is good to go from my side |
Merged, there we no additional comments to this PR nor the original #210 |
Thanks @kabir I tweeted it |
This replaces #210 and is hopefully simpler and gives us a more positive spin on it.
I spoke to Stuart about the Quarkus router API that Emmanuel mentioned in the old PR, and he recommended not to use it.