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

Allow to serve Quinoa application on a specific path #302

Open
gbourant opened this issue Apr 6, 2023 · 1 comment
Open

Allow to serve Quinoa application on a specific path #302

gbourant opened this issue Apr 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@gbourant
Copy link

gbourant commented Apr 6, 2023

The Quinoa extension operates in a particular way, as illustrated in the attached image. When an HTTP request is made, it first reaches the Quinoa extension. If the extension doesn't find the resource, it looks for it in META-INF/resources, and if that fails too, it forwards the request to the REST API. However, the problem is that if we intend to develop a web application that uses Quarkus Qute to handle the requests in the root path '/', we can't do that since Quinoa has higher priority, and it would serve the Quinoa app instead.

To resolve this issue we can modify the Quinoa extension's configuration to serve the application in a different path. For instance, we can configure the extension to serve the Quinoa app in the path '/quinoa', while the Quarkus Qute-based web application would be served in the root directory '/'.

By implementing this solution, we can have both the Quinoa app and the Quarkus Qute-based web application running simultaneously, without any conflicts.

The following Qute-based web application is never served since the Quinoa-based application gets served.

@Path("/")
@ApplicationScoped
public class HtmlResource {

    @Inject
    Template index;

    @Inject
    Template cart;

    @GET
    public TemplateInstance getIndex() {
        return index.instance();
    }

    @GET
    @Path("cart")
    public TemplateInstance getContant() {
        return cart.instance();
    }

}

@pahjbo
Copy link

pahjbo commented Mar 19, 2024

I too would like this feature - as although #299 did provide a way of making this apparently work in dev mode with a combination of path ignores - it fails when deployed. The cleanest solution to this would be to allow the SPA to be at a non-root path. My motivation for wanting this functionality is a combination of the original use case of the quarkus quinoa app being part of a set of microservices deployed to k8s behind a proxy, and wanting to follow a https://datatracker.ietf.org/doc/html/draft-ietf-oauth-browser-based-apps-14#name-token-mediating-backend architecture.

pahjbo added a commit to orppst/pst-gui that referenced this issue Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants