Skip to content

Conversation

kabir
Copy link
Contributor

@kabir kabir commented Jun 6, 2019

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.

@rsvoboda
Copy link
Member

rsvoboda commented Jun 6, 2019

@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.
Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

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.

@emmanuelbernard
Copy link
Member

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.
@kabir
Copy link
Contributor Author

kabir commented Jun 6, 2019

@emmanuelbernard I have updated it. Unless my latest changes introduced something weird you pick up on, it is good to go from my side

@rsvoboda rsvoboda merged commit 14c8f86 into quarkusio:develop Jun 7, 2019
@rsvoboda
Copy link
Member

rsvoboda commented Jun 7, 2019

Merged, there we no additional comments to this PR nor the original #210

@emmanuelbernard
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants