webiny-js
webiny-js copied to clipboard
Expose configuration for website app preview Cloudfront
Is your feature request related to a problem? Please describe.
We are currently configuring our website domain and would like the preview domain to also be configurable, but it's not exposed in the app.resources during the createWebsiteApp function.
Describe the feature's behavior.
When a user is working with the page builder, and they want to see work in progress, they get taken to the prerendering service and it's on an internal domain. We'd like to expose that so that our users would be taken to something like web-preview.mydomain.com
Describe alternatives you've considered.
Leaving the configuration free and manually managing it. It is working at the moment because the custom headers are not applied to it - so it works if I add our wild card cert and alternate domain name to cloud front and configure the front end. Longer term, it'd be better to have this be something that's scripted :)
@timruppert @adrians5j does this look acceptable?

I'm trying to come up with the simplest possible solution. This one seems rather simple, but it will require you to have both delivery and preview domains be handled by the same certificate.
Alternatively, we can do this, to completely detach preview and delivery domains configuration:

Awaiting your feedback :)
I'd like to implement 2nd solution. @Pavel910 can you green-light it please?
@adrians5j let's go with the 2nd option 👍
Thanks! Will submit PR soon!