如何编辑 local.ini 以使用 couchdb 启用 CROS
how to edit local.ini to enable CROS with couchdb
我有一个简单的应用程序,使用 couchdb 和 angular..
我需要使用 angular http 注入获取存储在 couchdb 中的数据。
但是我在控制台中有这个错误:"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin"
搜索后我发现我必须编辑位于此路径的 local.ini 文件:
C:\CouchDB\etc
但我有这个错误:"the permission do not allow you to make modifications"
问题:有什么方法可以让我编辑这个文件(我正在使用 windows)
你在使用 CouchDB 2.XX 吗?如果是,您只需转到 Fauxton (host/_utils
) 并在配置选项卡中单击启用 CORS 并设置允许的域。
否则,如果您使用的是 CouchDB 1.6.1,则可以转到配置选项卡并添加以下 category/key 值:
httpd/enable_cors true
cors/origins *
cors/credentials true
cors/method GET, PUT, POST, HEAD, DELETE
cors/headers accept, authorization, content-type, origin, referer, x-csrf-token
请参阅 this link 了解更多说明
我有一个简单的应用程序,使用 couchdb 和 angular.. 我需要使用 angular http 注入获取存储在 couchdb 中的数据。 但是我在控制台中有这个错误:"No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin"
搜索后我发现我必须编辑位于此路径的 local.ini 文件: C:\CouchDB\etc 但我有这个错误:"the permission do not allow you to make modifications"
问题:有什么方法可以让我编辑这个文件(我正在使用 windows)
你在使用 CouchDB 2.XX 吗?如果是,您只需转到 Fauxton (host/_utils
) 并在配置选项卡中单击启用 CORS 并设置允许的域。
否则,如果您使用的是 CouchDB 1.6.1,则可以转到配置选项卡并添加以下 category/key 值:
httpd/enable_cors true
cors/origins *
cors/credentials true
cors/method GET, PUT, POST, HEAD, DELETE
cors/headers accept, authorization, content-type, origin, referer, x-csrf-token
请参阅 this link 了解更多说明