map the middleware on servers