https://github.com/ahmed-dinar/football_manager
Football Manager App (Backend)
https://github.com/ahmed-dinar/football_manager
expressjs nodejs rest-api
Last synced: 3 months ago
JSON representation
Football Manager App (Backend)
- Host: GitHub
- URL: https://github.com/ahmed-dinar/football_manager
- Owner: ahmed-dinar
- Created: 2018-06-30T06:36:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-30T20:39:51.000Z (almost 7 years ago)
- Last Synced: 2024-12-27T09:12:16.897Z (5 months ago)
- Topics: expressjs, nodejs, rest-api
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Football Manager App (Backend)
| | |
| :--- | :--- |
| Language | Javascript (NodeJS) |
| Framework | ExpressJS |
| Database | MySQL |
| Database Name | football_manager |```
$ npm install
$ node server.js
```## API Documentation
**Base Url: http://localhost:3000**
##### ``POST /api/signup``
> manager registration```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded'
}body: {
email: '',
name: ''
password: '',
confirmPassword: ''
}
``````javascript
Success Response: 200
Error Response: 400
```##### ``POST /api/signin``
> manager login```javascript
headers: {
Content-Type: application/x-www-form-urlencoded
}body: {
email: '',
password: ''
}
``````javascript
Success Response: 200
{
access_token: '',
payLoad: {}
}
Error Response: 401
```##### GET ``/api/team/list``
> get current logged in managers team list```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}
``````javascript
Success Response: 200
[]
Error Response: 401
```##### ``POST /api/team/create``
> create a team```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}body: {
name: '',
origin: '',
net_worth: ''
}
``````javascript
Success Response: 200
Error Response: 400
```##### ``GET /api/team/:teamName``
> get a specific team details```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}
``````javascript
Success Response: 200
{}
Error Response: 400
```##### ``GET /api/team/:teamName/players``
> get a specific team's player list```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}
``````javascript
Success Response: 200
[]
Error Response: 400
```##### ``GET /api/team/:teamName/player/:playerName``
> get a specific team's player details```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}
``````javascript
Success Response: 200
{}
Error Response: 400
```##### ``POST /api/team/:teamName/addplayer``
> add a player to a team```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}body: {
name: '',
position: '',
rating: '',
salary: ''
}
``````javascript
Success Response: 200
Error Response: 400
```##### ``POST /api/team/:teamName/delete/:playerName``
> detele a player from a team```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}
``````javascript
Success Response: 200
Error Response: 400
```##### ``POST /api/team/:teamName/update/:playerName``
> update a player info of a team```javascript
headers: {
Content-Type: 'application/x-www-form-urlencoded',
access_token: ''
}body: {
position: '',
rating: '',
salary: ''
}
``````javascript
Success Response: 200
Error Response: 400
```