Example 4147

API Routes

REST API route definitions.

{
base_url: "/api/v1"
routes: [
{
method: "POST"
path: "/users/:id"
handler: "getUsers"
auth: true
}

{
method: "PUT"
path: "/users"
handler: "listOrders"
auth: false
}

{
method: "PUT"
path: "/orders/:id"
handler: "listPosts"
auth: false
}

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

{
method: "DELETE"
path: "/posts/:id"
handler: "listUsers"
auth: false
}

{
method: "DELETE"
path: "/comments"
handler: "listOrders"
auth: true
}
]
}

See also