Skip to content

1346 - API Routes

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

maml
{
  base_url: "/api/v3"
  routes: [
    {
      method: "DELETE"
      path: "/comments"
      handler: "deleteUsers"
      auth: true
    }

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

    {
      method: "GET"
      path: "/products/:id"
      handler: "getProducts"
      auth: false
    }

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

See Also