Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

FROM oven/bun:1.0.25


WORKDIR /app


COPY package.json bun.lockb ./


RUN bun install --frozen-lockfile


COPY . .


RUN bun run build


ENV NODE_ENV=production
ENV PORT=3000


EXPOSE 3000

# 启动服务
CMD ["bun", "run", "start:sse"]

2 changes: 2 additions & 0 deletions src/server/sse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const startSSEServer = async () => {
const transports: { [sessionId: string]: SSEServerTransport } = {}

app.get("/sse", async (_: Request, res: Response) => {
res.write("data: connected\n\n");

const transport = new SSEServerTransport("/messages", res)
transports[transport.sessionId] = transport
Logger.info("New SSE connection established", {
Expand Down