-
Notifications
You must be signed in to change notification settings - Fork 0
/
enpoint.txt
123 lines (106 loc) · 2.77 KB
/
enpoint.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
post a hotel
POST http://localhost:8000/api/hotels
{
"name":"burj al arab",
"type":"hotel",
"city":"sharjah",
"address":"street",
"distance":"200",
"title":"Best hotels",
"desc":"description",
"cheapestPrice":10000
}
check all the hotels in each city
GET http://localhost:8000/api/hotels/countByCity?cities=dubai,abudhabi,sharjah
response [
5,
1,
5
]
check all the hotels
GET http://localhost:8000/api/hotels
change hotel
POST http://localhost:8000/api/hotels/
{
"name": "change hotel name"
}
hotels marked as featured true in database will be shown
GET http://localhost:8000/api/hotels?featured=true&limit=2&min=10&max=200
user signup
POST http://localhost:8000/api/auth/register
{
"username": "alisha2",
"email": "[email protected]",
"password": "12345"
}
user login
POST localhost:8000/api/auth/login
{
"username": "alisha2",
"password": "12345"
}
create room in a hotel with hotel id
POST localhost:8000/api/rooms/66548bd74993e1d528fb252a
check and reserve room in each hotel with hotel id
GET localhost:8000/api/hotels/room/66548bd74993e1d528fb252a
check user
GET http://localhost:8000/api/users/checkuser/6654e764b43912753c7523ca
change username
PUT http://localhost:8000/api/users/6654e764b43912753c7523ca
GET http://localhost:8000/api/hotels?featured=true&limit=3
response [
{
"_id": "66548bd74993e1d528fb252a",
"name": "Radisson Blue",
"type": "hotel",
"city": "abu dhabi",
"address": "street",
"distance": "200",
"photos": [],
"title": "Best hotels",
"desc": "description",
"rooms": [
"66563e32ab50d48f9fa84bb8",
"668167ceb17ad6f45bc2134f"
],
"cheapestPrice": 100,
"featured": true,
"__v": 4,
"updatedAt": "2024-06-30T14:12:30.426Z"
},
{
"_id": "6654977137c6f8b28ed620b8",
"name": "Golden Tulip",
"type": "hotel",
"city": "sharjah",
"address": "sharjah",
"distance": "200",
"photos": [],
"title": "Best hotels",
"desc": "description",
"rooms": [
"66563d14ab50d48f9fa84bac"
],
"cheapestPrice": 120,
"featured": true,
"__v": 1,
"updatedAt": "2024-05-28T20:22:44.692Z"
},
{
"_id": "6656451794bc2be0db471243",
"name": "Hampton by Hilton",
"type": "hotel",
"city": "sharjah",
"address": "street",
"distance": "200",
"photos": [],
"title": "Best hotels",
"desc": "description",
"rooms": [],
"cheapestPrice": 130,
"featured": true,
"createdAt": "2024-05-28T20:56:55.654Z",
"updatedAt": "2024-05-28T20:56:55.654Z",
"__v": 0
}
]