test(streaming logs): more test but failed again
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type {Context} from "hono";
|
||||
import {db} from "../../../../database/dbclient.js";
|
||||
import {and, eq, gt} from "drizzle-orm";
|
||||
import {streamSSE} from "hono/streaming";
|
||||
import {streamSSE, streamText} from "hono/streaming";
|
||||
import {logs} from "../../../../database/schema/logs.js";
|
||||
|
||||
export async function streamLogs(c: Context) {
|
||||
|
||||
@@ -29,6 +29,11 @@ app.openapi(
|
||||
}),
|
||||
async (c) => {
|
||||
apiHit(c, {endpoint: `api/logger/logs`});
|
||||
c.header("Access-Control-Allow-Origin", "*"); // Or restrict to a specific origin
|
||||
c.header("Access-Control-Allow-Headers", "Content-Type");
|
||||
c.header("Content-Type", "text/event-stream");
|
||||
c.header("Cache-Control", "no-cache");
|
||||
c.header("Connection", "keep-alive");
|
||||
return streamLogs(c);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user