Closed jde closed 8 years ago
As of now we are building a single JS bundle per Form as: [someid].js
This file is used in the embed code option:
<div id="ask-form"></div><script src="http://localhost:4444/widgets/57a20634c29ca00006dfa8f2.js"></script>
To serve a standalone file we could: a) create an HTML file with the iframe code and the JS bundle b) create an HTML file with the iframe code referencing the JS bundle
That said, you still need some web server to host these files and make them accesible.
On the funny side of things, looks like Amazon forces download of HTML files: https://s3.amazonaws.com/nyt-stage/57a20634c29ca00006dfa8f2.html
Pinging @impronunciable too for opinions.
@pablocubico
1 - I'll go for a) that will make the form render FAST (also we can add a SW and make it work offline (?))
2 - The download force can be mitigated setting the content type as text/html
So, this is mostly working except that we need to store at least the base URL somewhere, as we are doing some hardcodish duct-taping to show the URLs.
elkhornHost
, using Elkhorn as proxy.Related PRs: https://github.com/coralproject/elkhorn/pull/79 https://github.com/coralproject/cay/pull/587
Please never hardcode urls, even if it is to see something working. They have caused much pain so far.
I believe the idea is that:
So Elkhorn knows where the files go based on configuration. Cay knows where the files are for that form.
So, should we create an issue to make Pillar store the address?
I'm removing the "blocked" tag since @pablocubico is going to do the pillar work.
cc @jde
@pablocubico is this for review now?
not yet! working on it
Concerning where to save the location(s) of published file(s), the settings
parameter is of type interface{} meaning that it will capture and return any data structures that you throw at it. You can add the published locations with no updates to Pillar like so:
form.settings.publishedUrl
This is now ready for review, we are storing the baseUrl
for a form in:
form.settings.baseUrl
and the one for a gallery in
gallery.config.baseUrl
Which is also of interface{}
type on PIllar.
Create a form and check all the embed codes, they should reflect your Elkhorn
config (S3 or filesystem). Publish a gallery and do the same check.
We are publishing static galleries and forms. The links that we use to target them, however, proxy through elkhorn.