Creating Endpoints
Endpoints are the core of mockd. Each endpoint responds to a specific HTTP method and path with the response you define.
Creating an Endpoint
Section titled “Creating an Endpoint”- Open your project from the dashboard
- Click New Endpoint
- Fill in the configuration:
| Field | Description |
|---|---|
| Method | HTTP method (GET, POST, PUT, PATCH, DELETE) |
| Path | URL path (e.g. /api/users) |
| Status Code | HTTP status code to return (e.g. 200, 404) |
| Response Body | The content returned to the caller |
| Content-Type | Response content type (defaults to application/json) |
Path Parameters
Section titled “Path Parameters”Paths support dynamic segments. For example, /api/users/:id matches any request to /api/users/123, /api/users/abc, etc.
Response Body
Section titled “Response Body”The response body can be any valid text. For JSON responses, enter valid JSON:
{ "users": [ { "id": 1, "name": "Alice" }, { "id": 2, "name": "Bob" } ]}Endpoint URL
Section titled “Endpoint URL”Once created, your endpoint is available at:
https://<project-slug>.mockd.sh/<path>