RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
534 stars 129 forks source link

Running pizzapi inside my node app gives me a timeout #56

Closed dineshraj closed 8 years ago

dineshraj commented 8 years ago

My code at the moment is basically this

var pizzapi = require('pizzapi');

var app = express();

pizzapi.Util.findNearbyStores(
    '90210',
    'Delivery',
    function(storeData){
        console.log('data: ', storeData);
    }
);

However in the command line I get the following error..

data:  { success: false,
  message:
   { [Error: connect ETIMEDOUT 205.218.22.12:443]
     code: 'ETIMEDOUT',
     errno: 'ETIMEDOUT',
     syscall: 'connect',
     address: '205.218.22.12',
     port: 443 } }

Do you know why this would happen?

RIAEvangelist commented 8 years ago

Thats a legit timeout if you go to the address it is not available.

Click Me HTTP case

Click Me HTTPS case

dineshraj commented 8 years ago

Yes true, but I was under the impression that this module should work out of the box? Why is it timing out, what IP is it trying to connect to?

RIAEvangelist commented 8 years ago

Is that the production setting??

huh should be orders.dominos.com or something similar.

RIAEvangelist commented 8 years ago

There is no refrence to : 205.218.22.12 in the code

dineshraj commented 8 years ago

The IP does seem to point to Dominos when doing a WHOIS lookup:

http://whois.domaintools.com/205.218.22.12

0x6c66 commented 8 years ago

Looks like Dominos is rerouting everyone accessing orders.dominos.com from outside the US.

RIAEvangelist commented 8 years ago

:+1:

@4m4rOk are you looking for local access?

0x6c66 commented 8 years ago

At the moment I'm running a server in the US, which is enough to play around with your wrapper a bit. I might have a look at Europe later though!

Slightly off-topic: Do you know if Domino's have a rather aggressive flood control in place?

RIAEvangelist commented 8 years ago

@4m4rOk _yes_ they do have very aggressive anti DOS in place. They will block you for about 15 min.

It's kind of like this :

blocked

johnhforrest commented 8 years ago

@RIAEvangelist Do you have any details on the limits of the API? Is there a key system in place with Dominos to prevent hitting the limit? Would love to hear more about this.