Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request / Question] Dynamic origins for CORS #359

Open
jellydn opened this issue Nov 29, 2024 · 0 comments
Open

[Feature Request / Question] Dynamic origins for CORS #359

jellydn opened this issue Nov 29, 2024 · 0 comments

Comments

@jellydn
Copy link

jellydn commented Nov 29, 2024

Could we have a similar option for CORS with moleculer-web as Express works with cors package?

Refer https://expressjs.com/en/resources/middleware/cors.html#configuring-cors-w-dynamic-origin

const cors = require('cors')
const app = express()

const corsOptions = {
  origin: function (origin, callback) {
    // db.loadOrigins is an example call to load
    // a list of origins from a backing database
    db.loadOrigins(function (error, origins) {
      callback(error, origins)
    })
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant