Example 14556

API Routes

REST API route definitions.

{
base_url: "/api/v2"
routes: [
{
method: "GET"
path: "/users"
handler: "updatePosts"
auth: false
}

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

{
method: "PATCH"
path: "/products/:id"
handler: "updateUsers"
auth: false
}

{
method: "DELETE"
path: "/comments/:id"
handler: "updateOrders"
auth: true
}

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

{
method: "PUT"
path: "/comments"
handler: "getPosts"
auth: false
}

{
method: "PATCH"
path: "/orders"
handler: "createProducts"
auth: false
}
]
}

See also