我试图使用api-平台的所有特性来测试这个解决方案。我不想用码头堆叠来理解建筑。
我的测试API现在已经创建并可以使用。
入口点:http://api.localhost
我的问题是什么时候我将安装管理与官方教程。
src/App.js文件
http://localhost:3000
当我尝试访问admin:http://localhost:3000时,我得到了消息Unable to retrieve API documentation。
控制台里没有留言。如果我检查我的网络选项卡,我可以使用正确的响应查看对API的调用。
如果你有任何想法..。我把他们都搞定了!
发布于 2018-05-19 18:47:58
我已经找到了解决这个问题的办法。
在nelmio_cors.yaml中,必须在expose_headers中添加Link。
该文件必须如下所示:
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['*']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
allow_headers: ['Content-Type', 'Authorization']
expose_headers: ['Content-Disposition', 'Content-Length', 'Link']
max_age: 3600
paths:
'^/': ~https://stackoverflow.com/questions/50394139
复制相似问题