-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Disable swagger docs in prod #1520
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
Conversation
|
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.
No issues found across 1 file
Greptile OverviewGreptile SummaryWraps the Swagger UI registration in a conditional check to only enable it when Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Server
participant Fastify
participant SwaggerUI
Server->>Fastify: Register Swagger API
Note over Fastify: Always registered
alt NODE_ENV === "development"
Server->>SwaggerUI: Register Swagger UI
SwaggerUI-->>Server: Load static assets
else NODE_ENV === "production"
Note over Server,SwaggerUI: Skip Swagger UI registration
Note over Server: Prevents SEA binary file errors
end
|
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 file reviewed, 1 comment
| await app.register(fastifySwaggerUI, { | ||
| routePrefix: "/documentation", | ||
| }); | ||
| // Only register Swagger UI in development - SEA binaries can't load static files |
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.
Typo in comment: "developement" should be "development"
| // Only register Swagger UI in development - SEA binaries can't load static files | |
| // Only register Swagger UI in development - SEA binaries can't load static files |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/server/src/server.ts
Line: 147:147
Comment:
Typo in comment: "developement" should be "development"
```suggestion
// Only register Swagger UI in development - SEA binaries can't load static files
```
How can I resolve this? If you propose a fix, please make it concise.
why
When trying to run the server binary, was seeing
Error: ENOENT: no such file or directory, open 'C:\Users\Administrator\Desktop\python\stagehand-python-stainless\bin\sea\static\logo.svg'what changed
Only registering swagger docs when NODE_ENV is
developementtest plan
Will confirm that this resolves the error
Summary by cubic
Disable Swagger UI in production by registering it only when NODE_ENV is "development". This prevents SEA binary runtime errors caused by missing static assets (e.g., logo.svg).
Written for commit 46282a2. Summary will update on new commits.