export const host = "https://battleship.sprinthub.ru/" function request(method, body, callback) { const options = { method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json' } }; fetch(host + "api/" + method, options) .then(res => res.json()) .then(res => callback(res)) } export default request;