I am not quite getting how the minimal example can be applied to my web app.
In the client code I override the doCall
method:
override def doCall(req: Request) = {
println(req)
MyServer.routes.apply(req)
}
But how can the client know about MyServer
?
Of course, here it works since all code is in the same file, but in reality the client and server communicate via the shared crossproject.
Do I need to write the doCall
explicitly with dom.ext.Ajax.post
?
I believe what you want is the longer example. The minimal example demonstrates the Autowire API within the same project (not extremely useful). The longer example demonstrates a true client/server interaction.
For example, it shows how
doCall
can be implemented with an AJAX call: