VVibeFlui

Endpoint Config

endpoint maps schema operations to HTTP requests. Endpoint config can be a single string or an operation map.

Endpoint shapes

TS
export const usersSchema = {
  resource: "users",
  endpoint: "/api/users"
} as const;
TS
export const usersSchema = {
  resource: "users",
  endpoint: {
    list: { url: "/api/users", method: "GET" },
    detail: { url: "/api/users/:id", method: "GET" },
    create: { url: "/api/users", method: "POST" },
    update: { url: "/api/users/:id", method: "PATCH" },
    delete: { url: "/api/users/:id", method: "DELETE" },
    archive: { url: "/api/users/:id/archive", method: "POST" }
  }
} as const;

Endpoint object

PropertyPurpose
urlRequest URL. Supports :param placeholders.
methodHTTP method. Defaults by operation when omitted.
headersStatic request headers.
queryStatic query values merged with runtime query values.

Default methods

OperationDefault method
createPOST
updatePATCH
deleteDELETE
actionPOST
Other operationsGET

Identity placeholders

Endpoint placeholders are filled from identity.

TS
export const usersSchema = {
  resource: "users",
  identity: {
    key: "uuid",
    param: "userId"
  },
  endpoint: {
    update: { url: "/api/users/:userId", method: "PATCH" }
  }
} as const;

For a row with { uuid: "u_123" }, the URL resolves to /api/users/u_123.

Query merge

Endpoint object query values are merged with runtime query values. Runtime values can override the same keys.

TS
endpoint: {
  list: {
    url: "/api/users",
    method: "GET",
    query: {
      include: "role"
    }
  }
}

Request body

The built-in endpoint provider sends values as the request body for non-GET and non-DELETE methods. Objects are serialized as JSON unless a Content-Type header is already provided. FormData, Blob, and string bodies are handled separately.

Common mistakes

  • Keep backend business logic on the backend. Endpoint schema should describe request wiring only.
  • Unresolved placeholders are left as :param text in the URL.
  • GET and DELETE requests do not receive a request body from the endpoint provider.