Here is the difference, when you using your develop machine make the routing, but you are visit the data source from our WMS server, and we do not provide any routing service on our wms server, so there is no way you can make it work.
But after you publish your application, your client will visit the interface you provide and anything they do is request to your server, in this time, your server will request the datasource in your local machine(maybe the same machine with your publish server, maybe in same lan), so it can be work, that's why we give the data to you and you can deal with it.
The key part is your client never do any calculate or routing in their side, they just simply request the result from your server.
I hope this is clear, if not, feel free to let us know.
And for "can a layer (route layer) be serialized and deserialzed", the answer is yes, we have serialized in our code community.