<p>我正在通过<code>localhost:8000</code>上的elm反应堆运行elm前端。它应该通过<code>localhost:8010</code>上的gunicorn从一个<strong>falcon后端</strong>加载json文件。这失败了。在</p>
<p>前端可以加载由elm reactor(<code>:8000</code>)提供服务的静态虚拟文件,但当我尝试用实际的后端(<code>:8010</code>)替换这些虚拟文件时,由于缺少标头而失败:</p>
<blockquote>
<p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading
the remote resource at <a href="http://localhost:8010/api/sheets" rel="nofollow">http://localhost:8010/api/sheets</a>. (Reason: CORS
header 'Access-Control-Allow-Origin' missing).</p>
</blockquote>
<p>来自Firefox检查器的错误消息似乎相当清楚,但我不知道如何修复它。我已经在falcon安装了一个CORS中间件,但这根本没有改善情况。在</p>
<pre><code>from falcon_cors import CORS
cors = CORS(allow_origins_list=['*'])
api = falcon.API(middleware=[cors.middleware])
</code></pre>
<p>我也尝试过使用起源<code>'localhost:8000'</code>和{<cd6>},但都不起作用。在</p>
<p>你知道怎么解决这个问题吗?在</p>