Skip to content

1151 - API Routes

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

maml
{
  base_url: "/api/v3"
  routes: [
    {
      method: "POST"
      path: "/posts"
      handler: "updateUsers"
      auth: false
    }

    {
      method: "PUT"
      path: "/orders"
      handler: "listUsers"
      auth: true
    }

    {
      method: "GET"
      path: "/users"
      handler: "deleteProducts"
      auth: true
    }

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

    {
      method: "GET"
      path: "/orders"
      handler: "listProducts"
      auth: true
    }

    {
      method: "PUT"
      path: "/orders"
      handler: "deletePosts"
      auth: true
    }
  ]
}

See Also