Skip to content

150 - API Routes

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

maml
{
  base_url: "/api/v2"
  routes: [
    {
      method: "POST"
      path: "/orders"
      handler: "deleteOrders"
      auth: true
    }

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

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

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

See Also