1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
const axios = require('axios'); const newClient = ({ playerName, challengerURL }) => { const start = () => axios({ method: 'POST', url: `${challengerURL}/api/register`, headers: { 'Content-Type': 'application/json;charset=utf-8' }, data: playerName, }) .then(({ data }) => data); return { start, }; }; module.exports = { newClient, };