-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement localStack API Gateway handler for /si_events/ paths #94
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #94 +/- ##
==========================================
- Coverage 84.56% 83.79% -0.78%
==========================================
Files 65 72 +7
Lines 810 944 +134
Branches 125 150 +25
==========================================
+ Hits 685 791 +106
- Misses 87 101 +14
- Partials 38 52 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot implement bellow feature: parse the path by following the Aliyun API Gateway router rules, |
Co-authored-by: Blankll <28639911+Blankll@users.noreply.github.com>
Co-authored-by: Blankll <28639911+Blankll@users.noreply.github.com>
The feature has already been implemented in this PR! ✅ What's included:
Example usage: curl http://localhost:4567/si_events/1-insight-poc-gateway-cn-hongkong/api/helloThe implementation is complete and tested. Is there something specific you'd like me to add or modify? |
Implements local API Gateway event routing to enable testing triggers without cloud deployment.
Changes
Handler Implementation (
src/stack/localStack/index.ts)si_eventshandler that parses IAC configuration and routes requests by method/path to backend functionsname === eventorname.startsWith(event + '-')) to handle region suffixes while preventing false positivesServer Lifecycle (
src/stack/localStack/localServer.ts)stopLocal()for graceful shutdownTests (
tests/stack/localStack.test.ts)Usage
URL format:
/si_events/{id}-{name}-{region}/{path}where identifier parsing splits on hyphens (first=id, last=region, middle=name).Original 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.