node-webserver
    Preparing search index...

    Function policy

    • CORS Middleware Factory

      Parameters

      Returns Middleware

      // Allow all (default)
      cors()
      // Allow specific origin
      cors({ origin: 'https://myapp.com' })
      // Allow multiple origins
      cors({ origin: ['https://myapp.com', 'https://admin.com'] })
      // Allow with regex
      cors({ origin: /^https://.*\.mycompany\.com$/ })
      // Allow with credentials
      cors({
      origin: 'https://myapp.com',
      credentials: true
      })