Express.js API Endpoints

GET API

URL: http://localhost:3000/info/:pathParam?queryParam=value

Method: GET

Description: Returns both query parameter and path parameter as JSON.

Example: http://localhost:3000/info/123?queryParam=hello
 
expected response:
{
  "message": "GET API Response",
  "pathParam": "123",
  "queryParam": "hello"
}

-----------------------------------------------------------------------------

POST API

URL: http://localhost:3000/data

Method: POST

Description: Accepts JSON data in the request body and returns an array of data.

Headers: Content-Type: application/json

Post Data (request body json):
{
    "name": "Vijay",
    "age": 25
}

expected response:
{
    "message": "POST API Response",
    "data": [
        {
            "name": "Vijay",
            "age": 25
        }
    ]
}