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

module.exports = function (app) {
  app.use(
    "/api/v1/",
    createProxyMiddleware({
      target:
        "https://open-1ebd2eca-38fc-4ad7-bb20-98fa78f440af-console.kube.ucas/",
      changeOrigin: true,
      secure: false,
      pathRewrite: { "": "" },
    })
  );
  app.use(
    "/saturn/api/",
    createProxyMiddleware({
      target: "https://test-www.kube.ucas/",
      changeOrigin: true,
      pathRewrite: {
        "^/saturn/api/": "/api/",
      },
      secure: false,
    })
  );
};
