move the client code so it can be served by the same server