UNPKG

majidapi

Version:
27 lines (26 loc) 944 B
const config = require("./config"); const axios = require("axios"); module.exports = { football360: ({method = "competitions", page = 1, id = "",}) => { return new Promise(resolve => { axios.get(`${config.api}/football360?action=${method}&page=${page}&id=${id}`) .then(r => { config.success(resolve, r); }) .catch(err => { config.error(resolve, err); }); }) }, footballi: ({method = "competitions", cursor = 1, id = "",}) => { return new Promise(resolve => { axios.get(`${config.api}/footballi?action=${method}&cursor=${cursor}&id=${id}`) .then(r => { config.success(resolve, r); }) .catch(err => { config.error(resolve, err); }); }) } }