summaryrefslogtreecommitdiff
path: root/lambda-calcul/javascript/src/client.js
blob: d2de0d4146f485368714692891fdf97309b46740 (plain)
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,
};