Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Rest store url return 404 when calling from js

Vote:
 

Hello,

I've try to create sample add-on which has a rest store, but whenever my add-on try to access rest store, it return 404 in url

RestStore code:

[RestStore("DemoStore")]
    public class DemoStore : RestControllerBase    
    {}

JS code:

return declare([_Module], {
        // summary: Module initializer for the default module.

        initialize: function () {

            this.inherited(arguments);

            var registry = this.resolveDependency("epi.storeregistry");
            
            //Register the demo store
            registry.create("demoapp", this._getRestPath("demostore"), { id: "demoId" });
        },

        _getRestPath: function (name) {
            return routes.getRestPath({ moduleArea: "demoapp", storeName: name });
        }
    });

The url giving 404 is: 

http://localsite:17000/modules/demoapp/Stores/demostore/?demoId=10199%3A92DA48D3-85C3-4655-9372-875144985373&dojo.preventCache=1420714488950

I've tried to search for documentation but no luck. Any help is much appriciate!

#115039
Jan 08, 2015 12:18
Vote:
 

Hi,

First thing: your REST Store name is mismatch. [RestStore("DemoStore")] in C# code and this._getRestPath("demostore") in JS code is not matched (case sensitive).

Second thing: is  your moduleArea: "demoapp" matchs the addon name? Is your addon demoapp.dll?

Hope this help.

T.

#115040
Edited, Jan 08, 2015 12:33
Vote:
 

Aww, my bad. Thanks!

#115080
Jan 09, 2015 4:26
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.