How can you enable CORS for specific domains in your Node.js application?

  • Use the 'Access-Control-Allow-Origin' header
  • Set 'CORS: true' in the application settings
  • Use the 'enableCORS()' function
  • CORS is enabled by default in Node.js
To enable CORS (Cross-Origin Resource Sharing) for specific domains in a Node.js application, you should use the 'Access-Control-Allow-Origin' header in your HTTP response. This header specifies which domains are allowed to access your resources. The other options are not the correct way to enable CORS.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *