Remove legacy api.ts monolith (1,134 lines dead code) #125
Reference in New Issue
Block a user
Delete Branch "copilot/remove-legacy-api-ts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Removes
scripts/api.ts(1,134 lines), superseded by the refactoredscripts/app.ts+ modular routes/services architecture. The legacy file lacked input validation, structured logging, Sentry integration, and Swagger docs present in the refactored path.Changes
Deleted
scripts/api.ts- Legacy monolithic API file with known security issues (path injection, request forgery)Updated entry points
package.json-start:api→scripts/start-api-server.tsDockerfile.api- CMD →start-api-server.ts.nycrc- Removed from exclude listUpdated references (10 files)
CONTRIBUTING.md- Test examples now usecreateAppfromscripts/appdocs/- Updated all references fromscripts/api.tsto refactored architectureVerification
createAppfromscripts/app.tsnpm run start:apicorrectly invokesstart-api-server.tsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Pull request overview
This pull request successfully removes the legacy monolithic
scripts/api.tsfile (1,134 lines of dead code) that has been superseded by a refactored modular architecture. The refactored system usesscripts/start-api-server.tsas the entry point andscripts/app.tsas the app factory, with proper separation of concerns through services, routes, and middleware.Changes:
scripts/api.tsmonolith that lacked input validation, structured logging, and modern security featuresReviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
scripts/api.tspackage.jsonstart:apiscript to usescripts/start-api-server.tsDockerfile.apiscripts/start-api-server.ts.nycrcscripts/api.tsfrom coverage exclude listCONTRIBUTING.mdcreateApp()from refactored architecturedocs/ops/HASHICORP_VAULT.mdstart-api-server.tsdocs/ops/AWS_SECRETS_MANAGER.mdstart-api-server.tsdocs/SECURITY_HEADERS_SUMMARY.mddocs/RATE_LIMITING_SECURITY_SUMMARY.mddocs/DEVELOPMENT_SETUP.mddocs/DEBUGGING.mdstart-api-server.tsdocs/CONTRIBUTOR_ONBOARDING.mddocs/CACHING_IMPLEMENTATION_SUMMARY.mddocs/API_REFACTORING.md💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.