TwicPics / components

A Web component library that brings the power of TwicPics to your favorite web framework.
MIT License
54 stars 2 forks source link

Supporting domain with path #4

Closed YannDuv closed 2 years ago

YannDuv commented 2 years ago

I currently work on a Vue3 project that is deployed in three separated environments. The way we handled those environments is by having a specific path to each other: https://<our-domain>.twic.pics/<our-env-path> The problem is that when I try to feed the vue configuration with app.use(TwicPics, { domain: 'https://<our-domain>.twic.pics/<our-env-path>'}), I got this error:

Uncaught (in promise) Error: twicpics-components install domain "https://<our-domain>.twic.pics/<our-env-path>" is invalid
mbgspcii commented 2 years ago

Hello @YannDuv and thank you for using TwicPics Components.

Your use case is indeed not supported.

In the current version, the configuration template expects for domain a value as configured on your TwicPics account. eg: https://<our-domain>.twic.pics.

That said, we find your idea of using paths at configuration time interesting.

The configuration of your requirement would become

app.use(TwicPics, { domain: 'https://<our-domain>.twic.pics', path:'<our-env-path>' })

We are working on it right now.

mbgspcii commented 2 years ago

Hello @YannDuv .

Version 0.6.5 should allow you to configure the path in the installation phase (https://github.com/TwicPics/components/blob/main/documentation/vue3.md#setup-options).

To resume your example, you can now use

app.use(TwicPics, { domain: 'https://<our-domain>.twic.pics', path:'<our-env-path>' })

Hope this helps.

YannDuv commented 2 years ago

Thank you ✨