app.js - server side index-file.
public/index.html - client-side index-file.
Service is based on REST principles and supports next client-requests:
1. Authorization
Request: POST /login (body: {"uid":useruid, "password":userpassword})
Response: if successful: 200, OK
if failed: error.code, error.message
2. Get all reservations
Request: GET /reservations
Response: if successful: JSON in the next format:
{
"roomId": roomId,
"date": startdate,
"userId": userUid,
"endDate": endDate
}
if failed: error.code, error.message
3. Create new reservation
Request: POST /reservations (body:
{
"roomId": roomId,
"date": startdate,
"endDate": endDate
})
Response: if successful: 200, OK
if failed: error.code, error.message
4. Remove reservation
Request: DELETE /reservations (body:
{
"roomId": roomId,
"date": startdate
})
Response: if successful: 200, OK
if failed: error.code, error.message