Example 6654

API Routes

REST API route definitions.

{
base_url: "/api/v2"
routes: [
{
method: "PATCH"
path: "/products"
handler: "createPosts"
auth: false
}

{
method: "POST"
path: "/users/:id"
handler: "getProducts"
auth: true
}

{
method: "PUT"
path: "/posts/:id"
handler: "getOrders"
auth: false
}

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

{
method: "PUT"
path: "/orders/:id"
handler: "deletePosts"
auth: true
}

{
method: "DELETE"
path: "/posts"
handler: "createOrders"
auth: true
}
]
}

See also