edge icon indicating copy to clipboard operation
edge copied to clipboard

Add Typeform backend

Open ghost opened this issue 7 years ago • 3 comments

Tried to setup Typeform example form through Fly Sites in UI, but Preview link took me back to https://www.typeform.com/. Could this be because it's a free account and the form is private?

Typeform URL: https://kittybot.typeform.com/to/Su91j4

ghost avatar Jan 16 '19 01:01 ghost

TypeForm might be tough as a backend. I don't think it'll work at all with a private form. We'll need a list of forms to run tests against, most likely.

For this type of app, the basic steps to making it work as a backend are:

  • Find the right combination of Host and X-Forwarded-Host headers to get it to respond without a redirect. You can test this using something like curl -D - -o /dev/null -sS https://kittybot.typeform.com/to/Su91j4 -H "X-Forwarded-Host: somecustomdomain.com" -H "kittybot.typeform.com"
  • Once you have curl returning HTTP/1.1 200, you can build a proxy function in the CDN to send requests there.
  • Lots of these types of apps need URLs in HTML or JavaScript/CSS to be rewritten. The best way to figure out where things are breaking is to load up a proxy version in the browser, see what images and styles are missing, then click around and see if there's anything that sends you to
    .typeform.com.

mrkurt avatar Jan 16 '19 17:01 mrkurt

Quick note: Updating the form to "public" did not fix the problem on my end. Will work through the above.. Thanks!

ghost avatar Jan 17 '19 02:01 ghost

@WesleyDavid and I poked at this yesterday, this seems like what it takes to do a basic Typeform backend: https://gist.github.com/mrkurt/cbe97a7674d5edc7704e4ce925d4f8e1

mrkurt avatar Jan 23 '19 23:01 mrkurt