-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Support for nodejs #59
Comments
No, noting planned. Patch welcome! |
Thanks, I will take a look. |
Assuming the presence of the "xmlhttprequest" NPM package (e.g. via lein-npm), then this works fine: https://gist.github.com/moea/63d7a882e4ad333f3b5a Performing that kind of global adjustment is obviously a less-good idea in a library intended for reuse. If there was interest in including something similar, I think the lowest-impact approach would be to include an (require '[cljs.nodejs :as nodejs])
(require '[cljs-http.core :as http])
(def xhr (.-XMLHttpRequest (nodejs/require "xmlhttprequest"))
(http/set-xhr-factory! (http/xhr-factory #(xhr.)))
;; use library normally Which isn't too bad, and doesn't require there to be anything vaguely Node-specific in cljs-http. |
I would find an implemented version of this very useful as well. HTTP(S) + Node + CLJS seems like a pretty common/powerful usecase? |
@vikeri Maybe this is helpful meanwhile https://github.com/nervous-systems/kvlt |
I managed to get it working. But |
Is there planned support for cljs running under nodejs (in a server environment) ?
Thanks
The text was updated successfully, but these errors were encountered: