【问题标题】:Sencha Architect model REST proxy gives errorSencha Architect 模型 REST 代理给出错误
【发布时间】:2022-12-21 07:12:45
【问题描述】:

我有一个在端口 5000 上运行的本地 Nodejs 服务器。

我使用 Sencha Architect,我想从我的 Nodejs 服务器加载名为“getUsers”的 API。

这是我的模型:

Ext.define('Hivemind.model.MyModel', {
     extend: 'Ext.data.Model',

     requires: [
         'Ext.data.field.Field',
         'Ext.data.proxy.Rest'
     ],

     fields: [
         {
             name: 'id'
         },
         {
             name: 'name'
         }
     ],

     proxy: {
         type: 'rest',
         url: 'http://localhost:5000/getUsers'
     }
 });

请注意,“http://localhost:5000/getUsers”也可以通过浏览器轻松访问

但它给了我以下错误:

Please make sure that the URL you set for your proxy is either local, or similar to the URL you set in your projects settings. 

If you plan to use a different domain, please use a JsonP proxy.

如果这很重要,项目文件夹保存在桌面上的某个位置,而 Nodejs 服务器文件存储在不同的位置

【问题讨论】:

    标签: node.js rest extjs proxy architect


    【解决方案1】:

    您只需确保在项目设置中指向的 URL 与代理 URL 字段中的内容相同。

    但是,我的经验是这并不重要。该项目仍将正确构建和部署。

    【讨论】:

      猜你喜欢
      • 2012-10-06
      • 2013-08-02
      • 2012-10-09
      • 2023-03-26
      • 2022-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-01
      相关资源
      最近更新 更多