Connect middleware for setting Access-Control headers