[aerogear-dev] aeroGear.pipeline not working

Kris Borchers kris at redhat.com
Tue Mar 19 09:33:05 EDT 2013


Soumik,

As Sebastien said in his response, you will not be able to access the `members` resource from that pipe. AeroGear.js is not aware of the structure of your server side resources so what it does is assume the name of the pipe you are creating is the endpoint for your `members` resource. Also, AeroGear.js does assume the same context when accessing the REST endpoints so if your resource is on another app context, you would want to use the full URL for that resource. That being said, I imagine what you wanted was the following:

var memberPipe = AeroGear.Pipeline([{
	name: "members",
	settings: {
		baseURL: "http://localhost:8080/JAX_RS_HelloWorld/helloworld/"
	}
}]).pipes.members;

Thanks for taking a stab at using AeroGear and please let us know if you have any other questions or feedback!

Kris

On Mar 19, 2013, at 8:08 AM, "soumik.basu" <soumik.basu at accenture.com> wrote:

> Hi team,
>  I am using the jquery as javascript library for my app. I  just thought of
> including aerogear Rest service call instead of Jquery ajax call, so was
> trying out with a small sample code. But the request was not getting fired.
> I have deployed my sample Rest app as a separate project under a different
> context. I can acces it from my browser as :
> http://localhost:8080/JAX_RS_HelloWorld/helloworld.
>  I am trying to access this from :
> http://localhost:8080/html5Start/test1.html page.
> I have written the code as: 
> var memberPipe  = AeroGear.Pipeline([{
> 		  	    name: "helloworld",
> 		  	    settings: {
> 		  	        baseURL: "JAX_RS_HelloWorld/"
> 		  	    }
> 		  	}  ]).pipes.members;
> 		  	alert(memberPipe);
> /I am getting undefined from this alert/
>   subs =	memberPipe.read();
> 
> 		  	alert(subs);
> 
> so the script is failing here. Is it compulsory that I need to access this
> Rest service from same context path as mentioned in the guide
> "By default, the RESTful endpoint used by this pipe is the app's current
> context, followed by the pipe name. For example, if the app is running on
> http://mysite.com/myApp, then a pipe named `tasks` would use
> http://mysite.com/myApp/tasks as its REST endpoint."...In that case what is
> the way to change the base url to access the service from a different
> context?
> 
> Please let me know if I am doing anything wrong here.
> 
> Thanks in advance.
> 
> Regards
> Soumik
> 
> 
> 			  
> 
> 
> 
> --
> View this message in context: http://aerogear-dev.1069024.n5.nabble.com/aeroGear-pipeline-not-working-tp1968.html
> Sent from the aerogear-dev mailing list archive at Nabble.com.
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev




More information about the aerogear-dev mailing list