Example 11659

API Routes

REST API route definitions.

{
base_url: "/api/v2"
routes: [
{
method: "PUT"
path: "/orders/:id"
handler: "getProducts"
auth: false
}

{
method: "POST"
path: "/comments"
handler: "updateUsers"
auth: false
}

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

{
method: "GET"
path: "/posts/:id"
handler: "updateUsers"
auth: true
}

{
method: "PATCH"
path: "/posts/:id"
handler: "updateProducts"
auth: true
}

{
method: "DELETE"
path: "/products/:id"
handler: "listProducts"
auth: false
}

{
method: "DELETE"
path: "/products/:id"
handler: "createUsers"
auth: true
}
]
}

See also