Example 5057

API Routes

REST API route definitions.

{
base_url: "/api/v2"
routes: [
{
method: "POST"
path: "/comments"
handler: "updatePosts"
auth: true
}

{
method: "PUT"
path: "/comments/:id"
handler: "getProducts"
auth: true
}

{
method: "GET"
path: "/comments"
handler: "getUsers"
auth: true
}

{
method: "POST"
path: "/orders/:id"
handler: "createOrders"
auth: false
}

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

{
method: "PUT"
path: "/products"
handler: "updateOrders"
auth: false
}

{
method: "DELETE"
path: "/users/:id"
handler: "updateUsers"
auth: false
}
]
}

See also