deployed at: https://luncher-bw.herokuapp.com/
POST /api/admins/register
- Register new admin by sending an object resembling
{
"username":"admin",
"password":"password",
"email":"[email protected]",
"first_name": "George",
"last_name": "Costanza"
}
POST /api/admins/login
- Login as admin by sending valid
{username, password}
- Get a json web token for use as authentication
GET /api/admins/
- Get list of all admins
GET /api/admins/:id
- Get admin by ID
POST /api/admins/:id/school
- Protected
- Register a school to admin by sending an object resembling
{
"school_name":"Summerside High School",
"address": "543 Cayan St",
"city":"Waterbury",
"state": "Connecticut",
"zipcode":"06704",
"funds_needed": 45000,
"funds_raised": 12000
}
DELETE /api/admins/:id
- Protected
- delete admin by ID
GET /api/schools
- Get list of all schools
GET /api/schools/:id
- Get school by ID
POST /api/schools/:id
- Send an object resembling
{ donation: 200 }
to make a donation to a school with specified ID - Get the new total amount of funds raised for school with specified ID
PUT /api/schools/:admin_id
- Protected
- Edit/Update school information with specified admin ID by sending an object containing any of a school's properties
- No admin is authorized to alter or change a school's admin ID, school ID, or amount of funds raised. Will return an error.
DELETE /api/schools/:id
- Protected
- Delete school by admin ID