const {createProxyMiddleware} = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    '/xxl-job-admin',
    createProxyMiddleware({
      target: 'http://jobs.ap-northeast-1.elasticbeanstalk.com:8080',
      changeOrigin: true,
      pathRewrite: {'^': ''},
    }),
  );

  app.use(
    '/admin/',
    createProxyMiddleware({
      // target: 'https://console.agicoin.ai/', //演示
      target: 'https://console.dev.aigic.ai/', //开发
      // target: 'http://192.168.1.121:8087/',
      // target: 'http://172.20.10.6:8087/',
      // target: 'http://localhost:8087/',
      
      changeOrigin: true,
      pathRewrite: {'^': ''},
    }),
  );

  app.use(
    '/api/',
    createProxyMiddleware({
      target: 'https://dev.aigic.ai/',
      // target: 'http://43.198.252.255:8000/',
      // target: 'http://192.168.1.108:8087/',
      changeOrigin: true,
      pathRewrite: {'^': ''},
    }),
  );
};
