sailthru / sailthru-node-client

Sailthru Node.js client
http://docs.sailthru.com
MIT License
17 stars 15 forks source link

allow for passing test api endpoint with custom port #21

Closed evantahler closed 9 years ago

evantahler commented 9 years ago

If you are testing this client locally, you might want to supply a local endpoint like http://127.0.0.1:8080. These changes are required to allow it.

robwil commented 9 years ago

This does not compile currently. You will need to use the Coffeescript is and isnt operators instead of the !== and ===. Yes, I hate Coffeescript too :frowning:

robwil commented 9 years ago

I believe this is what you are going for:

if parse_uri.port isnt undefined then parse_uri.port else (if parse_uri.protocol is 'https:' then 443 else 80)
evantahler commented 9 years ago

Yeah... coffee-script is a mess.

How about now?

robwil commented 9 years ago

LGTM. Will merge shortly. Getting to npm should be in next day or so.

evantahler commented 9 years ago

Thanks!

robwil commented 9 years ago

This is now on NPM FYI