使用EAK和ember数据-品味-适配器的最佳方法是什么?
我目前正在尝试以下几点:
localhost:7000上运行Djangolocalhost:8000上的EAKbower.jsonindex.html中我想我必须创建serializers/application.js并将其放入其中:
export default DS.DjangoTastypieSerializer.extend();另外,adapters/application.js需要调整:
export default DS.DjangoTastypieAdapter.extend({
serverDomain: 'http://localhost:7000',
});请求发送给Django,并发送响应。但是,在EAK中,这会给出"Sorry, something went wrong"消息,而不需要任何进一步的信息(空错误消息框)。控制台也没有错误。
如果删除serializers/application.js,将得到类似的消息,在本例中包含有关错误的信息:
Assertion Failed: Nested controllers need be referenced as [/django/tastypie],
instead of [_djangoTastypie].
Refer documentation: http://iamstef.net/ember-app-kit/guides/naming-conventions.html我必须在defaultSerializer中定义adapters/application.js吗?如果是这样的话,那是什么,/django/tastypie还是其他什么?
在EAK中,我缺少什么来集成适配器?问题是,我还没有看到EAK和tastypie合作的例子。
当然,这两个本地服务器系统都是开发环境。生产计划类似于这里,API和JS都由一个Django实例提供。
更新:通过grunt dist创建部署代码并使用grunt dist工作为其提供服务。
我怀疑问题在于不同的JSON来源。
发布于 2014-03-12 08:40:19
结果,EAK有API代理选项。
将package.json更新到我的API设置:
"proxyURL": "http://localhost:7000",
"proxyPath": "/api/v1",从adapters/application.js中删除自定义设置。
现在运行grunt server:proxy从Django获取数据。而ember.js应用程序的工作没有错误,最有可能的问题是不同的来源。
https://stackoverflow.com/questions/22325187
复制相似问题