Skip to content

843 - API Routes

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

maml
{
  base_url: "/api/v2"
  routes: [
    {
      method: "DELETE"
      path: "/products/:id"
      handler: "listPosts"
      auth: true
    }

    {
      method: "GET"
      path: "/products/:id"
      handler: "updateUsers"
      auth: true
    }

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

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

See Also