PokeAPI / pokedex-promise-v2

An easy way to use pokeapi v2 with promises in node.js
MIT License
510 stars 89 forks source link

Override url #13

Closed designgears closed 8 years ago

designgears commented 8 years ago

Would be nice to have a way to override the url without changing the code. :)

Naramsim commented 8 years ago

Why do you need to override the URL? Are you using Ditto?

designgears commented 8 years ago

Nope, running PokeAPI on my own server.

Naramsim commented 8 years ago

Ok, good feature! Maybe we can do something like this:

var Pokedex = require('pokedex-promise-v2');
var P = new Pokedex({
  protocol: 'http',
  hostname: 'localhost:3000'
});

With default parameters set to http and pokeapi.co so one can init the Pokedex with no parameters. Better to split hostname in hostname and port, or let them together?

What do you think @designgears @TheTommyTwitch

tasadurian commented 8 years ago

That sounds good. I would say keep hostname and port together in this instance.

Naramsim commented 8 years ago

Ok, perfect. @TheTommyTwitch, can I add webpack to our wrapper? It is a build system, you write es6 javascript and comes out a javascript compatible even with node 0.10. Can I?

tasadurian commented 8 years ago

Yeah 👍 on webpack.