Next.js API route for observing and analyzing signal data in the Sophra system
req: NextRequest
- The incoming request objectPromise<NextResponse>
- A promise resolving to the response containing signal statisticsreq: NextRequest
- The incoming request objectPromise<NextResponse>
- A promise resolving to the response containing detailed signal observationsData Flow Diagram
Database Errors
Validation Errors
Runtime Errors
Promise.all
to execute multiple database queries concurrently in the POST handler, improving response times for complex requests.
POSTGRESQL_URL
: Connection string for the primary databaseLOG_LEVEL
: Determines the verbosity of logging (e.g., ‘error’, ‘info’, ‘debug’)Signal
model with appropriate fields for source, type, timestamp, and metadata.