diff options
| author | Emmanuel Gaillot <emmanuel.gaillot@gmail.com> | 2025-12-20 19:39:05 +0100 |
|---|---|---|
| committer | Emmanuel Gaillot <emmanuel.gaillot@gmail.com> | 2025-12-20 20:25:10 +0100 |
| commit | 487fd6802ef2cb248dbabd804fac2ae4c91e76e9 (patch) | |
| tree | 0fef7f3b0036313121b09435217b67e8995782f5 /lambda-calcul/javascript/src/client.js | |
| parent | c608d95a2451d110d3a90d6a3c3a6aa7fb293295 (diff) | |
| download | lambda-nantes-487fd6802ef2cb248dbabd804fac2ae4c91e76e9.tar.gz | |
Register user
Diffstat (limited to 'lambda-calcul/javascript/src/client.js')
| -rw-r--r-- | lambda-calcul/javascript/src/client.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lambda-calcul/javascript/src/client.js b/lambda-calcul/javascript/src/client.js new file mode 100644 index 0000000..d2de0d4 --- /dev/null +++ b/lambda-calcul/javascript/src/client.js @@ -0,0 +1,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, +}; |
