Enabling CORS access

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsEnabling CORS access

To enable CORS access in DreamFactory, log in to the admin console and click on the 'Config' tab. Then click 'CORS' from the left menu. To create a new CORS access rule, click on the plus button ([+]) next to '-- Select CORS Entry --' drop down box. After that enter your allowed Origin, Paths, Headers, Max Age (browser caching CORS access), and Methods. The Paths field lets you control access to specific API paths. For example, if you only want to expose a database service named 'my_db' over CORS, you can put 'api/v2/my_db/*' in the Paths.

Tutorial enable cors.png

FAQS

Access to XMLHttpRequest at 'https://example.com/api/v2/' from origin 'http://test.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

  • Check that there are no spaces in your origins field.