npm install soccerama
import { Soccerama } from 'soccerama';
const soccerama = new Soccerama(__YOUR_API_TOKEN__, 'v2.0');
var Soccerama = require('soccerama').Soccerama;
var soccerama = new Soccerama(__YOUR_API_TOKEN__, 'v2.0');
var soccerama = new Soccerama(__YOUR_API_TOKEN__, 'v2.0'); // if second param is omitted api v1.2 will be used
soccerama.get(endpoint,params).then( function(data){
console.log(data);
});
you can get the endpoint from the official soccerama documentation omitting the base url and the parameters (that are set with the params field)
soccerama.get('countries').then( function(data){
console.log(data)
});
if you need to specify parameters you can set the params field as follow
soccerama.get('countries/{id}', { id: 13, competitions: true }).then( function(data){
//id in the params field will replace {id} in the endpoint
//competitions: true, will add include=competitions in query string
});