ATELIER TENIS API (Mustafa Jaxateh) My linkedIn
clic to see the app deployed on Heroku
For development, you will need MongoDB, Node.js, and NPM on your environement.
-
Just go on official Node.js website and download the installer. Also, be sure to have
git
available in your PATH,npm
might need it (You can find git here). -
You can install nodejs and npm easily with apt install, just run the following commands.
$ sudo apt install nodejs $ sudo apt install npm
-
You can find more information about the installation on the official Node.js website and the official NPM website.
If the installation was successful, you should be able to run the following command.
$ node --version
v16.13.1
$ npm --version
8.3.0
If you need to update npm
, you can make it using npm
! Cool right? After running the following command, just open again the command line and be happy.
$ npm install npm -g
Select the folder and run the below commands
$ git clone https://github.com/moustaphadiakhate/atelier_tenis.git
$ cd atelier_tenis
- Create a copy of
.env.template
and rename it.env
. - Remove the
#
from every line. $ npm run keygen
to generate api key if need$ npm run seed
put the data from /data/dataset.json to atelier_tenis mongoDB database
$ npm start
- Go to
localhost:3000
in a browser * Normal output looks like this:{"status":200,"result":"atelier_tenis api server.. nothing to see here"}
- keygen.js - Gives an api key to be used by ClientApi for next communications with atelier_tenis API in secure mode.
usage: npm run keygen
- databaeSeed.js - Put the data from /data/dataset.json to atelier_tenis mongoDB database
usage: npm run seed
Method : GET (obtenir les information d'un joueur specifique)
URL : http://localhost:3000/v0/players/get_player?id=52
Request : {}
Method : GET (obtenir les joueurs par ordre de leur rang)
URL :http://localhost:3000/v0/players/get_players
Request : {}
Method : GET (obtenir lae pays favori en termes de ratio)
URL :http://localhost:3000/v0/players/get_fav_contry
Request : {}
Method : GET (obtenir le IMC moyen des joueurs)
URL :http://localhost:3000/v0/players/get_player_imc_moyen
Request : {}
Method : GET (obtenir la mediade des tailles)
URL :http://localhost:3000/v0/players/get_heigth_median
Request : {}