Api Configuration
Configure APIs with URL prefixes and routing
Defines the basic configuration for an API, including its URL prefix for routing.
Schema properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| Prefix | string | Yes | - | URL prefix for the API endpoints (e.g., “/api/v1”, “/northwind”) |
YAML example
apiVersion: weik.io/v1
kind: Api
metadata:
name: northwind-api
spec:
Prefix: /northwind
Multiple APIs example
apiVersion: weik.io/v1
kind: Api
metadata:
name: products-api
spec:
Prefix: /api/products
---
apiVersion: weik.io/v1
kind: Api
metadata:
name: orders-api
spec:
Prefix: /api/orders
---
apiVersion: weik.io/v1
kind: Api
metadata:
name: customers-api
spec:
Prefix: /api/customers
Usage notes
Use Api configuration to define the base path for your API. The Prefix determines the URL structure where the API endpoints are accessible.
The prefix should:
- Start with a forward slash (
/) - Be unique across all APIs in your instance
- Follow URL path conventions (lowercase, hyphen-separated)
Example URL structure:
- API with prefix
/northwind→ Endpoints accessible athttps://your-host/northwind/... - API with prefix
/api/v1→ Endpoints accessible athttps://your-host/api/v1/...
Combine this configuration with ApiVersion to define specific versions and their settings.