Skip to content

051 - API Routes

REST API route definitions. This is an example of a MAML document.

maml
{
  base_url: "/api/v3"
  routes: [
    {
      method: "DELETE"
      path: "/users"
      handler: "updateProducts"
      auth: false
    }

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

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

    {
      method: "PUT"
      path: "/products"
      handler: "getUsers"
      auth: true
    }
  ]
}

See Also