@@ -5,19 +5,43 @@ This is a Java application that provides a REST API with endpoints for searching
5
5
6
6
Project developed as part of an assignment by Kaiburr.
7
7
8
- ### Table of contents
8
+ ## Table of contents
9
9
- Usage
10
10
- Endpoints
11
11
- Examples
12
12
13
- ### Usage
14
- 1. Download "server.jar" file into your local repository and cd into it
15
- 2. Make sure you have jdk 19 and mongodb 6 installed on your machine
16
- 3. start mongodb on your linux machine
17
- 4. run server.jar file
18
-
19
- ### Endpoints
20
-
21
-
22
- ### Examples
23
-
13
+ ## Installation
14
+ 1 . Download ** server.jar** file into your local repository and cd into it
15
+ 2 . Make sure you have jdk 19 and mongodb 6 installed on your machine
16
+ 3 . start mongodb on your machine. On linux that would be using:
17
+ > sudo sytemctl start mongod
18
+ 4 . run ** server.jar** file
19
+
20
+ ## Usage
21
+ Use ** postman** to get, post and delete
22
+
23
+ ## Endpoints
24
+ - GET ** '/'** - returns all server objects as json
25
+ - GET ** '/{id}'** - returns the server object that matches that id else returns a 404
26
+ - GET ** '/name/{name}'** - returns all server objects with names that contain the {name} string, else returns a 404
27
+ - PUT ** '/'** - takes in a JSON encoded message body and stores it in a mongodb server
28
+ - DELETE ** '/{id}'** - deletes the serves that the has {id} as its id
29
+
30
+ ## Examples
31
+ Examples of the API using ** Postman**
32
+ - GET ** '/'** :
33
+ ![ img_1.png] ( img_1.png )
34
+ - GET ** '/{id}'** :
35
+ - when id is found:
36
+ ![ img_2.png] ( img_2.png )
37
+ - when id is not found:
38
+ ![ img_3.png] ( img_3.png )
39
+ - GET ** '/name/{name}'** :
40
+ - when name is found:
41
+ ![ img_4.png] ( img_4.png )
42
+ - when name is not found:
43
+ ![ img_5.png] ( img_5.png )
44
+ - PUT ** '/'** :
45
+ ![ img_6.png] ( img_6.png )
46
+ - DELETE ** '/{id}'** :
47
+ ![ img_7.png] ( img_7.png )
0 commit comments