Example 16258

API Routes

REST API route definitions.

{
base_url: "/api/v1"
routes: [
{
method: "PUT"
path: "/users"
handler: "createUsers"
auth: false
}

{
method: "PATCH"
path: "/users/:id"
handler: "listPosts"
auth: false
}

{
method: "PUT"
path: "/products/:id"
handler: "deleteUsers"
auth: false
}

{
method: "PATCH"
path: "/comments/:id"
handler: "createProducts"
auth: false
}

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

{
method: "GET"
path: "/posts/:id"
handler: "createOrders"
auth: false
}

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

See also