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

module.exports = function (app) {
  app.use(
    "/api/v1/",
    createProxyMiddleware({
      target:
        "https://open-52398f05-7e35-4388-a8d5-f7f8ad25faa3-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,
    })
  );
};
