Hilla Endpoint Prefix in 2.5.6

Hi, i’m currently migrating a project from Hilla 1.3.2 to 2.5.6. The Webpage is located at /app and the Endpoints are located at /connect and in application.properties the setting vaadin.endpoint.prefix is pointing to /connect which works fine for 1.3.2.
Now when i’m using 2.5.6 the prefix in connect-client.default.ts seems to be hardcoded to “connect” and i see no way to change it.
When i try to call an endpoint ca http call like this is generated http://server:8081/app/connect/DebugEndpoint/test1 but the correct URL would be http://server:8081/connect/DebugEndpoint/test1
When instead i’m starting the project with 1.3.2 and looking into the generated file connect-client.default.ts it will correctly use the prefix “…/connect”

How is this supposed to work now?

You can configure the ConnectClient from @hilla/frontend to use a custom prefix: TypeScript Client | Reference | React | Hilla Docs. This is the corresponding code: hilla/packages/ts/frontend/src/Connect.ts at main · vaadin/hilla · GitHub

Hi René, thanx for your help. In the documentation you linked me, there is no information how to change the prefix. According to https://hilla.dev/docs/react/guides/endpoints this can be changed using application.properties but i assume since Hilla 2 this only allows you to change the server side, not the generated client code.
But you also linked me the ConnectClient, and yes i can import the default client into my index.ts and simply update the prefix-property. I hope this is the correct way to do.

It works now, thanx :slightly_smiling_face:

Hi marcoc, great i will comment on this for future considerations