1
I’m new to the world of Nodejs, I’d like to know why I can’t test the most basic document algorithm https://github.com/PokeAPI/pokedex-promise-v2
my code is like this:
var Pokedex = require('pokedex-promise-v2');
var options = {
protocol: 'https',
hostName: 'localhost:443',
versionPath: '/api/v2/',
cacheLimit: 100 * 1000, // 100s
tiemout: 5 * 1000 // 5s
}
var P = new Pokedex(options);
P.getBerryByName('cheri')
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log('There was an ERROR: ', error);
});
works in windows? I tried here and it was not.
– Felipe Cardozo
It doesn’t work on Windows. This is a Linux/Unix command. But what Teliz answered there is true. If removing the whole line of the options variable works, but in doing so it points by default to an external url url: 'http://pokeapi.co/api/v2/type/10/'
– Rogério Fonseca