Simple to use

Example API: www.abc.com/dist/api/lo…

Configuration mode:// manifest.json
    "h5" : {
        "devServer" : {
            "disableHostCheck" : true."proxy" : {
                "/api" : {
                    "target" : "https://www.abc.com/dist"."changeOrigin" : true}}}} Request example: uni.request({url:"/api/login". })Copy the code

The path to rewrite

Example API: www.abc.com/login

Configuration mode:// manifest.json
    "h5" : {
        "devServer" : {
            "disableHostCheck" : true."proxy" : {
                "/api" : {
                    "target" : "https://www.abc.com"."changeOrigin" : true."pathRewrite" : {
                        "^/api" : ""  // https://www.abc.com/login}}}}} Request example: uni.request({url:"/api/login". })Copy the code