Example 16042

API Routes

REST API route definitions.

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

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

{
method: "DELETE"
path: "/orders/:id"
handler: "updatePosts"
auth: false
}

{
method: "PATCH"
path: "/users/:id"
handler: "deleteProducts"
auth: true
}

{
method: "DELETE"
path: "/posts"
handler: "deleteProducts"
auth: false
}
]
}

See also