Here is what worked for me when I deployed to Heroku.
http://flask-cors.readthedocs.org/en/latest/
Install flask-cors by running – pip install -U flask-cors
from flask import Flask from flask_cors import CORS, cross_origin app = Flask(__name__) cors = CORS(app) app.config['CORS_HEADERS'] = 'Content-Type' @app.route("/") @cross_origin() def helloWorld(): return "Hello, cross-origin-world!"
Related Posts:
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- What’s the point of the X-Requested-With header?
- How to get a cross-origin resource sharing (CORS) post request working
- Get the data received in a Flask request
- Best way to store a key=>value array in JavaScript?
- Flask Template Not found
- What is different between $(document).on() and $(element).on()
- Flask ImportError: No Module Named Flask
- Copy to clipboard using jquery?
- Format date to MM/dd/yyyy in JavaScript
- how to use substr() function in jquery?
- How to fix the ‘Missing required request header. Must specify one of: origin,x-requested-with’ Ajax Error
- Javascript isnull
- jquery fadeIn not working
- bootstrap 3 navbar collapse button not working
- SON Post with Customized HTTPHeader Field
- Bootstrap collapse isn’t working; hamburger menu not showing up
- jQuery creating objects [duplicate]
- How do I make script load after jquery?
- WordPress AJAX File Upload – FrontEnd
- Best Practices for Seperating jQuery from HTML/PHP
- Add custom shortcode button to Editor
- Infinite scroll / lazy loading with NextGen Gallery [closed]
- WordPress: Sortable Metabox Fields Not Saving Position
- Click link on plugin/theme page and open the contextual help on a specific tab
- Why do we include jQuery in the header?
- Display admin_notice error message form jQuery event
- Defer Parsing of Scripts
- Unbind postbox click handler
- Querystring data gets truncated
- Displaying custom post-types in a Fancybox div and then linking to them
- wp_enqueue_script and wp_register_script in theme not working
- wp_localize_script, variable is not defined in jquery
- How to load a jQuery script last?
- Using wp_ajax and wp_ajax_nopriv hooks
- Hide/show customizer controls based on other settings in Customizer
- add_image_size and iPad Retina Display (high pixel density)
- jQuery on Underscores menu
- WP Media uploader loading only once in options page
- HTML5 Youtube wrapper works in jsfiddle but not in WP?
- Loading posts via AJAX in a hidden div with updated URL?
- Best way to include jQuery and fire with script at bottom of container
- Jquery not showing in homepage
- SmoothScroll not working in WordPress
- Disable stored tags queries in admin page when posting a new post
- WordPress Comments – Rich Text
- SSL issues with WordPress site
- Limit filetype and wp media
- Register jQuery – OOP WP
- How to isolate code to the post edit screen
- Good Solution for Adding jQuery Tabs Anywhere Within WordPress?
- Using jquery-1.7.2.min.js instead of the wordpress jquery
- Adding jQuery UI elements to WordPress page
- Superfish Menu Not Loading
- Disable Cloudflare Rocket Loader for jQuery javascript and make it load first
- Convert UL to dropdown list not working
- JQuery Counter Limit not working for WP Comment Textarea
- jQuery selectable() function won’t work in wordpress
- jQuery(selector) vs. $(selector)
- Null/undefined return in WordPress AJAX request
- How do I make Contact Form 7 pop up in thickbox? [closed]
- How To Include JavaScript Files Only In Single Posts?
- Determine image height within Fancybox
- How to use JQuery Marquee in WordPress?
- WordPress 3.2.1: jQuery is not defined, breaks Admin panel
- inner anchor scrolling with wordpress
- Bootstrap and jQuery error: $ is not defined
- Doing Math with Gravity Forms List
- JQuery is not working after complete load of the page
- I am trying to load a Js Dynamic Audio Synth [closed]
- Uncaught ReferenceError: jQuery is not defined
- Remove button from page if viewed through Customizer
- Carousel Slider For Custom PHP Snippet Is Not Working
- Target a specific page/template in jQuery
- why does so many javascript libraries are loaded along with my website?
- Why does my media selection script write to ONLY the first input field?
- Multiple level category drop-down three levels is not working
- Modify the href attribute of tag dynamically in WordPress
- Move jQuery on *top* of footer
- JQuery and Javascript to pan image
- How to add JS snippet before closing tag?
- Show/Hide text after the first paragraph
- Call admin ajax using absolute url? Relative URL breaks (frontend ajax)
- Responsive framework – edit child js
- Page keeps refreshing with Ajax form
- Check with jQuery value of checkbox from custom admin panel
- jquery issue in functions.php
- JS plugin script loading but not working
- WP Calendar Shortcode not working on my theme
- Hide input field when second input field is in focus
- Is it possible to append an external html file to my wordpress navigation?
- jscrollpane problem with my child theme
- Change image on post title hover (more than one instance) – Jquery
- How to fire jQuery after $(window).on(‘load’)
- I need a Pop up with description when i click an image
- My website si Blocked by google and warns the visitors that is Unsafe site
- how to make this work with jquery 1.12.4 [closed]
- Contact Form 7 – Submit Form not working After Ajax Request [closed]
- Making the Google Maps API non readable