How should I change nuxt, to add token, when I need to act as an agent?

nuxt,` proxy: {
    "/emr-server/v1/patient/**": {
      target: process.env.PP_SERVER || "http://pp-server:8080",
      logLevel: "debug",
      pathRewrite: {
        "^/emr-server/v1/patient": "/v1/patient",
      },
    },
    "/emr-server/**": {
      // target: "http://10.1.62.120:8085",
      target: process.env.EMR_SERVER || "http://10.1.62.120:8085",
      logLevel: "debug",
    },
  },
window.open()token`
Sep.30,2021

for more information, please refer to Link description
http-proxy-middleware to provide methods

option.onProxyReq: function, subscribe to http-proxy's proxyReq event.

function onProxyReq(proxyReq, req, res) {
    // add custom header to request
    proxyReq.setHeader('x-added', 'foobar');
    // or log the req
} 
Menu