I have a code for CORS configuration in NodeJS. It is as follows:
var allowedOrigin = new RegExp('^https?://(' + config.get('http:allowedOrigins').join('|') + ')(:\\d+)?(/.*)?$');
It gives this error to
SyntaxError: Invalid regular expression: /^https?://(*.dev.examplewebsite.com|0.0.0.0|192.168.1.1|.*)(:\d+)?(/.*)?$/: Nothing to repeat
at new RegExp (native)
at Object.<anonymous> (/Users/yagiz/Desktop/example/project-api/src/lib/handlers/cors.js:4:21)