Repository navigation
Expand file tree
/
Copy pathSuperSimpleDev Backend Documentation.html
More file actions
338 lines (319 loc) · 11.4 KB
/
Copy pathSuperSimpleDev Backend Documentation.html
File metadata and controls
338 lines (319 loc) · 11.4 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<!-- saved from url=(0044)https://supersimplebackend.dev/documentation -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SuperSimpleDev Backend Documentation</title>
<link rel="stylesheet" href="./SuperSimpleDev Backend Documentation_files/documentation.css">
<style>
@font-face {
font-family: 'NotoSans_online_security';
src: url(chrome-extension://llbcnfanfmjhpedaedhbcnpgeepdnnok/assets/fonts/noto-sans.woff);
}
@font-face {
font-family: 'NotoSans_bold_online_security';
src: url(chrome-extension://llbcnfanfmjhpedaedhbcnpgeepdnnok/assets/fonts/noto-sans-bold.woff);
}
@font-face {
font-family: 'NotoSans_semibold_online_security';
src: url(chrome-extension://llbcnfanfmjhpedaedhbcnpgeepdnnok/assets/fonts/noto-sans-semibold.ttf);
}
</style></head>
<body>
<main>
<h1 class="title" id="title">Documentation Page</h1>
<div class="intro">
This page shows you how to use this backend.
</div>
<div class="section-title">
Intro
</div>
<div>
To use this backend, send an HTTP request to the URL:<br>https://supersimpledevbackend.dev
</div>
<div id="table-of-contents" class="section-title">
List of URL paths
</div>
<div>
Here is a list of URL paths that are supported by this backend.<br>
Each URL path gives a different response when you send a request to it.
</div>
<div class="endpoint-links">
<code>
<strong>
<a href="https://supersimplebackend.dev/documentation#get-slash">GET /</a><br>
<a href="https://supersimplebackend.dev/documentation#get-hello">GET /hello</a><br>
<a href="https://supersimplebackend.dev/documentation#get-products-first">GET /products/first</a><br>
<a href="https://supersimplebackend.dev/documentation#get-documentation">GET /documentation</a><br>
<a href="https://supersimplebackend.dev/documentation#get-images-apple">GET /images/apple.jpg</a><br>
<a href="https://supersimplebackend.dev/documentation#get-products">GET /products</a><br>
<a href="https://supersimplebackend.dev/documentation#get-cart">GET /cart</a><br>
<a href="https://supersimplebackend.dev/documentation#post-orders">POST /orders</a><br>
<a href="https://supersimplebackend.dev/documentation#get-greeting">GET /greeting</a><br>
<a href="https://supersimplebackend.dev/documentation#post-greeting">POST /greeting</a><br>
</strong>
</code>
</div>
<section class="endpoint-section">
<div id="get-slash" class="endpoint">
<div class="endpoint-name">
GET /
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns a string.
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre>Hello! This is SuperSimpleDev's backend.
Documentation page:
https://supersimplebackend.dev/documentation</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="get-hello" class="endpoint">
<div class="endpoint-name">
GET /hello
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns a string.
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre>This is the URL path /hello</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="get-products-first" class="endpoint">
<div class="endpoint-name">
GET /products/first
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns the first product in the Amazon project as a JSON string.
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre>{
"id": "e43638ce-6aa0-4b85-b27f-e1d07eb678c6",
"image": "images/products/athletic-cotton-socks-6-pairs.jpg",
"name": "Black and Gray Athletic Cotton Socks - 6 Pairs",
"rating": {"stars": 4.5, "count": 87},
"priceCents": 1090,
"keywords": ["socks", "sports", "apparel"]
}</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="get-documentation" class="endpoint">
<div class="endpoint-name">
GET /documentation
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns the HTML of the documentation page (the current page) as a string.
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre><!DOCTYPE html>
<html>
<head>
<title>SuperSimpleDev Backend Documentation</title>
<link rel="stylesheet" href="documentation.css">
</head>
<body>
<main>
<h1 class="title" id="title">Documentation Page</h1>
...
</body>
</html></pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="get-images-apple" class="endpoint">
<div class="endpoint-name">
GET /images/apple.jpg
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns an image of an apple.
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<img src="./SuperSimpleDev Backend Documentation_files/apple.jpg">
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="get-products" class="endpoint">
<div class="endpoint-name">
GET /products
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns the list of products in the Amazon project as a JSON string.
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre>[{
"id": "e43638ce-6aa0-4b85-b27f-e1d07eb678c6",
"image": "images/products/athletic-cotton-socks-6-pairs.jpg",
"name": "Black and Gray Athletic Cotton Socks - 6 Pairs",
"rating": {
"stars": 4.5,
"count": 87
},
"priceCents": 1090,
"keywords": ["socks", "sports", "apparel"]
}, {
"id": "15b6fc6f-327a-4ec4-896f-486349e85a3d",
"image": "images/products/intermediate-composite-basketball.jpg",
"name": "Intermediate Size Basketball",
"rating": {
"stars": 4,
"count": 127
},
"priceCents": 2095,
"keywords": ["sports", "basketballs"]
}
...
]</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="get-cart" class="endpoint">
<div class="endpoint-name">
GET /cart
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Loads a fake cart.
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre>load cart</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="post-orders" class="endpoint">
<div class="endpoint-name">
POST /orders
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Takes a cart and creates a new order.
</div>
<div class="endpoint-request">
<strong>Request</strong><br>
In your request, send a cart array.
<code class="example-code">
<pre>{
cart: [{
productId: 'e43638ce-6aa0-4b85-b27f-e1d07eb678c6',
quantity: 2,
deliveryOptionId: '1'
}, {
productId: '15b6fc6f-327a-4ec4-896f-486349e85a3d',
quantity: 1,
deliveryOptionId: '2'
}]
}</pre>
</code>
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
Returns a new order object.
<code class="example-code">
<pre>{
"id": "0e3713e6-209f-4bef-a3e2-ca267ad830ea",
"orderTime": "2024-02-27T20:57:02.235Z",
"totalCostCents": 5800,
"products": [
{
"productId": "e43638ce-6aa0-4b85-b27f-e1d07eb678c6",
"quantity": 2,
"estimatedDeliveryTime": "2024-03-01T20:57:02.235Z"
},
{
"productId": "15b6fc6f-327a-4ec4-896f-486349e85a3d",
"quantity": 1,
"estimatedDeliveryTime": "2024-03-01T20:57:02.235Z"
}
]
}</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="get-greeting" class="endpoint">
<div class="endpoint-name">
GET /greeting
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns a greeting (string).
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre>Hello!</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
<div id="post-greeting" class="endpoint">
<div class="endpoint-name">
POST /greeting
</div>
<div class="endpoint-description">
<strong>Description</strong><br>
Returns a greeting (string).
</div>
<div class="endpoint-request">
<strong>Request</strong><br>
Send a JSON with a name property.
<code class="example-code">
<pre>{ name: "SuperSimpleDev" }</pre>
</code>
</div>
<div class="endpoint-response">
<strong>Response</strong><br>
<code class="example-code">
<pre>Hi SuperSimpleDev!</pre>
</code>
</div>
<a class="back-to-top-link" href="https://supersimplebackend.dev/documentation#title">
Back to top
</a>
</div>
</section>
</main>
</body></html>