algoliasearch-client-javascript icon indicating copy to clipboard operation
algoliasearch-client-javascript copied to clipboard

Angular module always returns 404

Open mspivak opened this issue 10 years ago • 3 comments

Using the Angular module, all requests return 404:

{"message":"Index products_local does not exist","status":404}

So I went to your awesome dashboard log and compared the angular request with the request your dashboard did, to find that the only difference was the host.

Your dashboard was querying: c2-use-2.algolianet.com. While my Angular app was querying: {APP_ID}-dsn.algolia.net.

So I did this to fix it:

var algoliaClient = algolia.Client(APP_ID, KEY, {
    hosts: {
        read: ['c2-use-2.algolianet.com']
    }
});

But, I don't think this is entirely correct. Please refer to issue https://github.com/algolia/algoliasearch-client-js/issues/183 since this might be related to the module I'm using.

Thanks in advance, I like your service very much. Eager to start using it!

mspivak avatar Dec 18 '15 00:12 mspivak

Please see our angular examples for how to use it exactly: https://github.com/algolia/algoliasearch-client-js/blob/master/examples/angular.html

APP_ID and KEY must be replaced by your very own values.

vvo avatar Jan 08 '16 10:01 vvo

Of course I was replacing APP_ID and KEY with my corresponding values. I just didn't wanted to paste them on Github. It now works without the hosts.read setting. Looks like it was a temporary thing.

mspivak avatar Jan 13 '16 23:01 mspivak

Ok @mspivak thanks for getting back here, it may be a DNS propagation issue (temp one).

vvo avatar Jan 14 '16 08:01 vvo