node index.js
By default server will start on localhost
addres and 3030
port
Request Method: GET
Request URL: /
Response code: 200
Response Body
{
"h1": "This is main page"
}
Request Method: GET
Request URL: /products
Response code: 200
Response Body
[
{
"id": 1,
"name": "Product 1"
},
{
"id": 2,
"name": "Product 2"
},
...
]
If unexisting URL accessed, srver will return
Response code: 404
Response Body
{
"h1": "Error 404",
"content": "This page not found"
}