Example 3256

API Routes

REST API route definitions.

{
base_url: "/api/v3"
routes: [
{
method: "GET"
path: "/comments/:id"
handler: "getPosts"
auth: true
}

{
method: "PUT"
path: "/users"
handler: "getPosts"
auth: true
}

{
method: "PATCH"
path: "/orders/:id"
handler: "getPosts"
auth: false
}

{
method: "POST"
path: "/products/:id"
handler: "listOrders"
auth: true
}

{
method: "DELETE"
path: "/comments"
handler: "createProducts"
auth: false
}

{
method: "DELETE"
path: "/comments/:id"
handler: "createProducts"
auth: false
}
]
}

See also