Added a CORS middleware and allowedDomain config option.