Skip to main content

My First Request

Get the backend running and make your first API request.

Start the Server

pnpm install
nx serve api

The API starts on localhost:3010 (HTTP) and :31225 (WebSocket).

Making a Request

The API is available at:

http://localhost:3010/api/v2

All requests go through the event engine which processes them as jobs. A basic data request looks like this from the frontend:

this.naoFlowService.reqData({
cfpSlug: 'project',
action: 'data/get-by-id',
data: { docId: 'your-document-id' },
naoQueryOptions: { docName: 'project', cfpPath: 'projects/projects' }
})
.execute()
.subscribe({
next: (res) => {
console.log('Response:', res);
},
error: (err) => {
console.error('Error:', err);
},
});

The response includes the document data along with metadata:

{
"ok": true,
"meta": {
"workerId": "worker-100",
"requestId": "CbK4V0VP6hL",
"mode": "active"
},
"data": [...]
}

Production Build

# Build for production
pnpm run prod

# Run the production bundle
node dist/apps/api/main.js

Next Steps