INNER CODE UNIT · TypeScript

server

ZhangJinHaHaHa/AgentLens · sandbox/src/testAgent/server.ts:27

const server = createServer(async (request, response) => {
  if (request.method === "GET" && request.url === "/audit/health") {
    writeJson(response, 200, buildHealthResponse());
    return;
  }

  if (request.method === "POST" && request.url === "/audit/solve") {
    try {
      const payload = (await readJsonBody(request)) as AuditSolveRequest;

      if (useLlm) {
        const result = await buildLlmSolveResponse(payload);
        writeJson(response, 200, result);
      } else {
        writeJson(response, 200, buildSolveResponse(payload));
      }
    } catch (error) {
      writeJson(response, 400, {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…