/health
Check that the local backend is running.
Developer docs
OnlyAPI scans a project tree and turns usable files into local runtime endpoints. Use this reference to create a workspace, upload a folder, preview auto-generated routes, and call them.
Quickstart
.function.js files for local serverless handlers that receive params, query, headers, and body.
Folder files
Drop in the folder you already have. OnlyAPI removes a shared project root, treats an
api folder as an optional route anchor when present, and creates routes from
the remaining file paths. Files without a method suffix become GET endpoints.
my-store-api/
custom/
status.json
health.json
items/
index.json
[id].json
orders/
{orderId}.patch.json
GET /custom/status
GET /health
GET /items
GET /items/:id
PATCH /orders/:orderId
Serverless functions
Add function before the JavaScript extension to make a route executable.
OnlyAPI removes that marker when it builds the route, then calls an exported
handler or default function at runtime.
api/
hello.get.function.js
jobs/
run.post.function.js
export function handler(event) {
return {
statusCode: 200,
headers: { "content-type": "application/json; charset=utf-8" },
body: JSON.stringify({
message: "Hello from OnlyAPI",
params: event.params,
query: event.query
})
};
}
Routing
api/health.get.json
GET /health
api/items/index.get.json
GET /items
api/items/[id].get.json
GET /items/:id
orders.create.post.json
POST /orders.create
Method suffixes are optional. Supported suffixes are get, post,
put, patch, delete, head, and
options; files without one default to GET. Dynamic segments can
use [id] or {id}. Hidden files and folders are skipped during
automatic route generation.
Management API
/health
Check that the local backend is running.
/api/projects
List project summaries sorted by most recently updated.
/api/projects
Create a project with name and optional description.
/api/projects/:projectId/upload
Upload files and regenerate the route inventory for a project.
/api/projects/:projectId
Fetch a full project with files, routes, activity, and usage stats.
Runtime
Runtime URLs use the project ID followed by the generated route path. A request to a JSON file returns the parsed data wrapped with OnlyAPI metadata and route params.
curl -X GET "https://onlyapi.wispbyte.app/runtime/api_abc123/items/sample-id"
{
"onlyapi": {
"projectId": "api_abc123",
"routeId": "generated-route-id",
"params": {
"id": "sample-id"
}
},
"data": {
"id": "sample-id",
"name": "OnlyAPI item"
}
}
Limits