Skip to main content

Overview

TrailBase allows you to create custom HTTP endpoints using WebAssembly components. These endpoints can handle any HTTP method, process request data, interact with the database, and return various response types.

Creating HTTP Endpoints

Basic Endpoint

Path Parameters

Extract dynamic segments from the URL path:

Query Parameters

Access URL query string parameters:

Request Body

Process request body data:

Headers

Access and set HTTP headers:

Response Types

JSON Response

HTML Response

Redirect Response

Binary Response

Database Integration

Endpoints can query and modify the database:

External API Integration

Make HTTP requests to external services:

Error Handling

Authentication

Access authenticated user information:

Example: Complete CRUD API

Next Steps

Server-Side Rendering

Render dynamic HTML pages

Jobs Scheduler

Schedule background tasks

WASM Components

Learn component development

Vector Search

Implement semantic search