-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add functional SSE gateway with keep-alive streaming #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # SSE Gateway (functional stream) | ||
|
|
||
| ## Run | ||
|
|
||
| ```bash | ||
| npm i express | ||
| node apps/sse-gateway/server.mjs | ||
| ``` | ||
|
|
||
| ## Test | ||
|
|
||
| ```bash | ||
| curl -N "http://localhost:5000/sse?q=email" | ||
| ``` | ||
|
|
||
| You should receive: | ||
| - `status` event | ||
| - `result` event | ||
| - periodic keep-alive comments (`: keep-alive`) | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||||||||||||||
| import express from "express"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const app = express(); | ||||||||||||||||||
| const PORT = Number(process.env.PORT) || 5000; | ||||||||||||||||||
|
||||||||||||||||||
| const PORT = Number(process.env.PORT) || 5000; | |
| const rawPort = process.env.PORT; | |
| const PORT = | |
| rawPort === undefined || rawPort === "" | |
| ? 5000 | |
| : Number.isNaN(Number(rawPort)) | |
| ? 5000 | |
| : Number(rawPort); |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,8 @@ | |||||||
| "example": "examples" | ||||||||
| }, | ||||||||
| "scripts": { | ||||||||
| "test": "echo \"Error: no test specified\" && exit 1" | ||||||||
| "test": "echo \"Error: no test specified\" && exit 1", | ||||||||
| "sse:gateway": "node apps/sse-gateway/server.mjs" | ||||||||
| }, | ||||||||
| "repository": { | ||||||||
| "type": "git", | ||||||||
|
|
@@ -22,6 +23,7 @@ | |||||||
| }, | ||||||||
| "homepage": "https://github.com/NguyenCuong1989/DAIOF-Framework#readme", | ||||||||
| "dependencies": { | ||||||||
| "@playwright/test": "^1.56.1" | ||||||||
| "@playwright/test": "^1.56.1", | ||||||||
| "express": "^4.21.2" | ||||||||
|
Comment on lines
+26
to
+27
|
||||||||
| "@playwright/test": "^1.56.1", | |
| "express": "^4.21.2" | |
| "@playwright/test": "^1.56.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Lockfile out of sync 🐞 Bug ☼ Reliability
express was added to package.json but package-lock.json was not updated, so lockfile-based installs can fail or omit express, causing apps/sse-gateway/server.mjs to crash at startup with a missing module error.
Agent Prompt
## Issue description
`package.json` declares `express`, but `package-lock.json` is not updated accordingly. This makes installs non-reproducible and can break lockfile-based installs, and can lead to runtime failure when starting the SSE gateway.
## Issue Context
The new SSE server imports `express`. The repo has an existing `package-lock.json` whose root dependency list does not include `express`.
## Fix Focus Areas
- package-lock.json[1-75]
- package.json[25-28]
## Suggested fix
1. Run `npm install` (or `npm install --package-lock-only`) at the repo root so the lockfile includes `express`.
2. Commit the updated `package-lock.json` (and ensure it adds the `express` package entries).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The run instructions suggest
npm i expressand running the server directly, but the PR also addsexpressto the rootpackage.jsonand annpm run sse:gatewayscript. To avoid mismatched dependency state and to match the documented workflow, update this README to usenpm install(root) andnpm run sse:gateway(optionally mentioningPORT=...).