-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor(exposition): remove express
#525
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #525 +/- ##
==========================================
- Coverage 56.13% 54.09% -2.05%
==========================================
Files 318 334 +16
Lines 10405 11144 +739
Branches 1260 1280 +20
==========================================
+ Hits 5841 6028 +187
- Misses 4564 5116 +552
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -83,9 +83,10 @@ export class Gateway extends Connector { | |||
throw new http.MethodNotAllowed() | |||
|
|||
const body = await request.parse() | |||
const query = Object.fromEntries(request.locator.searchParams) |
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.
It's not always a good idea to do 1:1 mapping between searchParams and an object as search params can have repeated queries (for example, to represent an array of value in a standard way).
Are we sure we never will want repeated parameters in the searchParams? I would rather keep query
as standard URLSearchParams
as it seems to be more flexible.
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.
Any operation in Toa accepts Request
type. Exposition definitely transforms HTTP Request into operation Request (body
goes to input
, and query string parsed into query
).
There is no such thing as an arbitrary query string in the Exposition. Anything not matching Query
type will not pass operation call's validation and result in Bad Request
.
The next step is the transition to HTTP2.