The server allows the user to register, to login, to upload, retrieve and delete their images through REST APIs. Moreover, it serves a simple website to easily interact with them. The APIs comply with the third level of HATEOAS principles, using http methods, status codes and hypermedia.
The requirements of the project are listed in this pdf file.
A complete description of all the served APIs is in this yaml file. The implemented APIs are the following (icon 🔒 means that a non-logged user is not able to get a successful response):
-
Send user credentials to login. The client session is updated with a cookie.
Method: POST
Endpoint: /login -
End the current session.
Method: POST
Endpoint: /logout -
Get the list of all the users of the application.
Method: GET
Endpoint: /api/users -
Create new user with name, id and password.
Method: POST
Endpoint: /api/users -
Get a list of snapshots with information about the images of the logged user.
Method: GET
Endpoint: /api/images -
Add an image file to the logged user's repository.
Method: POST
Endpoint: /api/images -
Retrieve an image file.
Method: GET
Endpoint: /api/images/:id -
Delete a single image from the logged user's repository.
Method: DELETE
Endpoint: /api/images/:id -
Retrieve a small preview of an image.
Method: GET
Endpoint: /api/images/:id/preview -
Get a list of snapshots with information about the images of the selected user, if authorized.
Method: GET
Endpoint: /api/users/:userId