I have a controller action that, after a certain process is finished, should render a JSON file containing a URL that links to a page displaying the results of that process. The user can then open this URL in their browser at a later point to see these results.
How can I generate this URL in the server that links to a page in the vue-client?
I am using grails 5.x with vue profile. The client is currently mapped to localhost:8081 while the server listens at localhost:8080
My problem is that I cannot generate the URL, because technically the server does not know the client URL (as far as I know).
Is there some variable in the server that contains the url (localhost:8081/) for the client? Or is there another way to generate this URL?
I tried grail's createLink
method, but it only generates server-side URLs (localhost:8080/controller-action):
res.resultUrl = createLink(controller: "REST", action: "remoteResults", params: [runID: res.runID], absolute: true)
but as I stated above I need the client url.
I don't want to just create a new action-view on the server side, because the Vue file for the Results page does already exist and is in use. Also I would not prefer to hardcode the URL, since it will change in the future.
PS:
request.resultURL
also returned only the server URL.