Unified routing for client/server javascript apps