Skip to content

js: pass request object as function argument & return response object#1604

Merged
achamayou merged 6 commits into
microsoft:masterfrom
letmaik:letmaik/js-request-arg
Sep 14, 2020
Merged

js: pass request object as function argument & return response object#1604
achamayou merged 6 commits into
microsoft:masterfrom
letmaik:letmaik/js-request-arg

Conversation

@letmaik
Copy link
Copy Markdown
Member

@letmaik letmaik commented Sep 11, 2020

...and expose the URL path parameters as well.

@letmaik letmaik requested a review from a team as a code owner September 11, 2020 15:09
@ghost
Copy link
Copy Markdown

ghost commented Sep 11, 2020

letmaik/js-request-arg@12689 aka 20200914.8 vs master ewma over 50 builds from 12087 to 12686
images

@letmaik
Copy link
Copy Markdown
Member Author

letmaik commented Sep 11, 2020

I'll extend this PR a bit more to also include returning a response object containing the body, status code, and headers. Then the low-level request/response interface is more or less complete I think.

Comment thread src/apps/js_generic/js_generic.cpp Outdated
int argc = 0;
JSValueConst* argv = nullptr;
int argc = 1;
JSValueConst* argv = (JSValueConst *)&request;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: this is supposed to be a (C-style) array, can we make it look more like one? Something like JSValueConst argv[] = {&request};?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it works like that, compiler is complaining as well: a value of type "JSValue *" cannot be used to initialize an entity of type "int32_t".

@letmaik letmaik changed the title js: pass request data as function argument js: pass request object as function argument & return response object Sep 11, 2020
@achamayou achamayou merged commit e7e6f7c into microsoft:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants