Skip to content
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

Node.js support for js-httpclient. #791

Merged
merged 6 commits into from
Dec 15, 2018
Merged

Node.js support for js-httpclient. #791

merged 6 commits into from
Dec 15, 2018

Conversation

EltonZhong
Copy link
Contributor

Node.js support for js-httpclient.

image

  • Create new compatble package to deal with difference in node and browser
  • Use 'node-fetch' to implement node.js fetch api. Add support for difference between node-fetch and window.fetch. Difference
  • I ran gradle clean :ktor-client:ktor-client-js:test but found no tests are ran.
    So could you provide the information for how to ran the js tests?
    And I run the compiled js file, found something like this, but I don't get why "Failed to fetch" should occur.
    image
    But when I test the client in my project, I find the it works well in node.js environment.
    Hope to recieve comments from you :)

@e5l e5l self-assigned this Dec 14, 2018
@e5l e5l self-requested a review December 14, 2018 05:19
@e5l
Copy link
Member

e5l commented Dec 14, 2018

Hi, @EltonZhong. Thanks for the PR.
To run js tests you should pass the property: -P enable-js-tests=true

@e5l
Copy link
Member

e5l commented Dec 14, 2018

You're in the right way. There are some minor issues to fix and then we could accept it.

@EltonZhong
Copy link
Contributor Author

You're in the right way. There is some minor stuff to fix and then we could accept it.

Thank you. I'll work on it. :)

@EltonZhong
Copy link
Contributor Author

Hi @e5l , the modifications have been done. Could you please review it? Thank you.

@e5l e5l merged commit f1a063a into ktorio:master Dec 15, 2018
schleinzer pushed a commit to schleinzer/ktor that referenced this pull request Feb 26, 2019
* Modify js client to suite node and browser

* Compatible lib to support browser and node

* Impl node.js getting buffer
@y9san9
Copy link

y9san9 commented Nov 25, 2020

So can I use Proxy in kotlin/node-js with ktor?
image

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.

4 participants