RoleFiles

Quickstart

Make a request to a running Rolefiles application.

The health endpoint is a small first request: it returns JSON and does not need an API key or database connection.

These examples use a local application at http://localhost:3000. Start the application with pnpm dev from the application repository. For a deployed instance, replace that origin with its actual application URL.

Send a request

curl --fail http://localhost:3000/api/v1/health
const response = await fetch("http://localhost:3000/api/v1/health")
if (!response.ok) throw new Error(`HTTP ${response.status}`)
console.log(await response.json())
import json
from urllib.request import urlopen

with urlopen("http://localhost:3000/api/v1/health", timeout=10) as response:
    print(json.load(response))

Run the JavaScript example with Node.js and the Python example with Python 3.

Read the response

A successful request returns HTTP 200 with:

{ "status": "ok" }

This confirms the application can respond to HTTP requests. It does not check database readiness, data freshness, or upstream sources.

If the connection fails, check that the application is running and the origin and port are correct. See the health reference for details.

On this page