A Next.js API route for generating and retrieving analytics reports within the Sophra system
GET
function, which is the handler for incoming HTTP GET requests. It takes a NextRequest
object as input and returns a Promise<NextResponse>
.
runtime
export specifies that this API route should use the Node.js runtime, enabling full access to Node.js APIs and ensuring compatibility with Sophra’s service architecture.timeWindow
parameter from the request URL, defaulting to “24h” if not provided.Data Flow