POST
/register
Register a user. If both username and password are provided, returns random user data.
Body (JSON)
username— string (required)password— string (required)
cURL
curl -X POST "$BASE/register" \
-H "Content-Type: application/json" \
-d '{"username":"alice","password":"s3cret"}'
Response
{
"success": true,
"user": {
"id": "kspm8t-2a4q9y1",
"username": "alice",
"token": "<random>",
"createdAt": "2025-01-01T00:00:00.000Z"
}
}