Comments (2)
I have the same problem. When deploying into tomcat6 my app is put into a context path, and fetch points at the root, rather than the context path. I'm happy to patch this if somebody can point me in the direction of figuring out what the context path is in a running app ?
from fetch.
OK, I've got a workaround.
- At first I pulled the context from the Ring request and passed that up to the .cljs and stitched it into the remote-uri var. Amusingly, something in the javascritp notices this and ADDS BACK IN the context path, so now I have it twice. So the original, incorrect, request goes to
when I want to to got to
http://myserver/mycontext/_fetch
and by changing remote-uri to "mycontext/_fetch" I now have
http://myserver/mycontext/mycontext/_fetch.
How fun.
I don't know enough to figure out who is responsible for doing this. Maybe xhr or tomcat, or some interaction ?
- So until a better solution can be found I've worked around the problem by adding a second _fetch handler to the noir side under the URI "/remotes/fetch" and on the cljs side stitched in a "remotes" to the remote-uri. Its not great, but its a workaround. So now by having this more complex URI the context gets magically reinserted and points to my handler. Baroque.
Code changes here:
https://github.com/ejackson/fetch/blob/master/src/noir/fetch/remotes.clj#L38
and here:
https://github.com/ejackson/fetch/blob/master/src/fetch/remotes.cljs
If anybody think of something better, or what I need to do to make this patchable, I'd love to fix this properly.
from fetch.
Related Issues (11)
- fetch.remotes is missing (:require [cljs.reader :as reader) HOT 1
- Allow defremote to accept optional doc strings.
- remotes cannot receive (to clojure) some unicode characters in strings
- Updating dependencies make fetch work again...
- Release 0.3.0 HOT 10
- Firefox unable to call remote function HOT 2
- Optionally allow remote to use webSockets
- Wait for return from server HOT 2
- Security HOT 2
- ReferenceError: fetch is not defined - cljs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fetch.