Documentation Page
This page shows you how to use this backend.
Intro
To use this backend, send an HTTP request to the URL:
https://supersimpledevbackend.dev
https://supersimpledevbackend.dev
List of URL paths
Here is a list of URL paths that are supported by this backend.
Each URL path gives a different response when you send a request to it.
Each URL path gives a different response when you send a request to it.
GET /
GET /hello
GET /products/first
GET /documentation
GET /images/apple.jpg
GET /products
GET /cart
POST /orders
GET /greeting
POST /greeting
GET /
Description
Returns a string.
Returns a string.
Response
Back to top
Hello! This is SuperSimpleDev's backend.
Documentation page:
https://supersimplebackend.dev/documentation
GET /products/first
Description
Returns the first product in the Amazon project as a JSON string.
Returns the first product in the Amazon project as a JSON string.
Response
Back to top
{
"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"]
}
GET /documentation
Description
Returns the HTML of the documentation page (the current page) as a string.
Returns the HTML of the documentation page (the current page) as a string.
Response
Back to top
<!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>
GET /products
Description
Returns the list of products in the Amazon project as a JSON string.
Returns the list of products in the Amazon project as a JSON string.
Response
Back to top
[{
"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"]
}
...
]
POST /orders
Description
Takes a cart and creates a new order.
Takes a cart and creates a new order.
Request
In your request, send a cart array.
In your request, send a cart array.
{
cart: [{
productId: 'e43638ce-6aa0-4b85-b27f-e1d07eb678c6',
quantity: 2,
deliveryOptionId: '1'
}, {
productId: '15b6fc6f-327a-4ec4-896f-486349e85a3d',
quantity: 1,
deliveryOptionId: '2'
}]
}
Response
Returns a new order object.
Back to top
Returns a new order object.
{
"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"
}
]
}
POST /greeting
Description
Returns a greeting (string).
Returns a greeting (string).
Request
Send a JSON with a name property.
Send a JSON with a name property.
{ name: "SuperSimpleDev" }
Response
Back to top
Hi SuperSimpleDev!