cors header missing vue api gateway

  1. Install the 'cors' package using npm:
npm install cors
  1. In your Vue.js project, create a file named 'vue.config.js' in the root if it doesn't exist.

  2. Inside 'vue.config.js', configure the devServer to use the 'cors' package:

module.exports = {
  devServer: {
    before: function (app, server, compiler) {
      const cors = require('cors');
      app.use(cors());
    }
  }
};
  1. Save the changes to 'vue.config.js'.

  2. Restart your Vue.js development server.

Note: Make sure to adjust the configuration based on your specific needs and security requirements.