0

I have a local Nodejs server running on port 5000.

I use Sencha Architect and I want to load the API with the name "getUsers" from my Nodejs server.

Here's my model:

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'
     }
 });

Note that "http://localhost:5000/getUsers" is also accessible simply by the browser

But it gives me the following error:

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.

If that matters, the project folder is saved somewhere on the Desktop, and the Nodejs Server files are stored on a different location

Smirlianos
  • 5
  • 1
  • 6

1 Answers1

0

You just need to make sure that in the project settings the URL pointed to is the same as what's in the proxy URL field.

However, my experience is that is doesn't really matter. The project will still build and deploy properly.

pjackson
  • 35
  • 7