This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Nathan Wright
Posted Sep 12 - Read on Facebook

Is there any way to change the hostname the framer prototype runs on? Currently runs on 127.0.0.1:8000 but would like to set custom hostname to communicate with an API (need to allow CORS whitelist)

4 Comments

Marc Krenn

Yes!

/Applications/Framer Studio Beta.app/Contents/Resources/python/reloader/server.py line 272ish

Marc Krenn

And more importantly, Framer has a built-in CORS proxy, so you can proxy around some limtations from within Framer IDE and when previewing projects on devices.

Try this function here:
https://gist.github.com/marckrenn/2bb78853e02af90c5904100a15398abe?fref=gc&dti=760188533992744

Instead of assigning your URLs directly, just wrap the function around it like this:
Utils.CORSproxy(http://www.framer.com)

Nathan Wright

Marc Krenn your method works well on my machine but doesn't work on framer cloud, any ideas if it's possible to get it working framer cloud?

Marc Krenn

The proxy won't work when your project is hosted on the web.

In order to get your project to work, open the framer.cloud link in Safari and then check

Develop -> Disable Cross-Origin Restrictions

If you'd host the file on your own server, you could disable cross scripting restrictions server-side as well.

Read the entire post on Facebook