Allow usage of plugin prefix on @eik/service#341
Allow usage of plugin prefix on @eik/service#341mfolkeseth wants to merge 1 commit intoeik-lib:mainfrom
Conversation
We need to to use Fastify plugin prefix https://www.fastify.io/docs/latest/Plugins/#route-prefixing-options and thus append pathname to host rather than replace. In the current situation this request will erase the path and directly append `pathname` after hostname/prococol. This proposal would append `auth/login` to the full server path given by the cli. If no plugin prefix is used, it will work with the default setup as it is today. This proposal will allow: ``` eik login --server http://localhost:4001/with/some/prefix ```
digitalsadhu
left a comment
There was a problem hiding this comment.
Thanks for the PR! This looks fine to me. I can't any issue with it myself. I'll let @trygve-lie chime in before merging.
|
Thanks for this PR. Just so I'm sure I read you correct; you want the Server Rest API to be available at: https://:assetServerUrl:port/:prefix/auth/login
https://:assetServerUrl:port/:prefix/pkg/:name/:version
etc..Am I correct? If yes, I do think we need to cater for this in the REST API too since we do a bit of logic on the URLs to find correct values. I am very open to adding such a feature. I clearly see this is something others would need too. |
|
Yes, that is correct. When we use the fastify plugin prefix (referenced above), the case you are describing is what we get here. So we need the cli to act accordingly. (I suspect you are somewhat familiar with our basePath structure at Amedia @trygve-lie) |
|
And by the way, I am more than happy to help out to make this happen as we are quite dependent on this feature. 👍 |
We need to to use Fastify plugin prefix https://www.fastify.io/docs/latest/Plugins/#route-prefixing-options and thus append pathname to host rather than replace.
In the current situation this request will erase the path and directly append
pathnameafter hostname/prococol.This proposal would append
auth/loginto the full server path given by the cli. If no plugin prefix is used, it will work with the default setup as it is today.This proposal will allow: