当前位置: 首页 > news >正文

南丰网站建设广州市疫情最新

南丰网站建设,广州市疫情最新,大连金州代做网站公众号,wordpress插件功能话不多说,直奔主题 $方式一 第一步,在根目录或/src 下新建一个 proxy.conf.json 文件 备注:这里不用纠结文件名称即xxx.xxx.json,只要使用时能找到,且正确配置文件内容格式即可 {"/dev-list": {"target…

话不多说,直奔主题

$方式一

  • 第一步,在根目录或/src 下新建一个 proxy.conf.json 文件

    备注:这里不用纠结文件名称即xxx.xxx.json,只要使用时能找到,且正确配置文件内容格式即可

    {"/dev-list": {"target": "https://a.examples.com/dev",	// 代理地址"secure": true,	// 接口是否开启 https"changeOrigin": true	// 支持跨域},"/dev-info": {"target": "https://a.examples.com/dev","secure": true,"changeOrigin": true},"/test-list": {"target": "http://b.examples.com/test","secure": false,"changeOrigin": true,"logLevel": "debug"	// 代理日志},"/test-info": {"target": "http://b.examples.com/test","secure": false,"changeOrigin": true,"logLevel": "debug"}
    }
    
  • 第二步,在 angular.json 文件中找到 architect 下的 serve ,并在 serve 内的 options 选项内配置 proxyConfig,没有就依次创建对应选项参数,事例如下:

    ...
    {"architect": {..."serve": {..."options": {...// 当前配置文件所做目录,相对于`angular.json`文件的位置,具体以实际配置位置为准"proxyConfig": "src/proxy.conf.json"	}}}
    }
    ...
    
  • 第三步,重启项目,验证成果

    说明:这里的 npm run start 实际指向的也是 ng serve 启动方式,故不用配置 --proxy-config

    npm run start 
    ===OR===
    ng serve
    

$方式二

  • 第一步,在根目录或/src 下新建一个 proxy.conf.js 文件

    备注:这里不用纠结文件名称即xxx.xxx.js,只要使用时能找到,且正确配置文件内容格式即可

    const PROXY_CONFIG = [{context: ["/dev-list","/dev-info"],"target": "https://a.examples.com/dev","secure": true,"changeOrigin": true},{context: ["/test-list","/test-info"],"target": "http://b.examples.com/test","secure": false,"changeOrigin": true,"logLevel": "debug"}
    ]module.exports = PROXY_CONFIG
    
  • 第二步,在 angular.json 文件中找到 architect 下的 serve ,并在 serve 内的 options 选项内配置 proxyConfig,没有就依次创建对应选项参数,事例如下:

    ...
    {"architect": {..."serve": {..."options": {...// 当前配置文件所做目录,相对于`angular.json`文件的位置,具体以实际配置位置为准"proxyConfig": "src/proxy.conf.js"	}}}
    }
    ...
    
  • 第三步,重启项目,验证成果

    说明:这里的 npm run start 实际指向的也是 ng serve 启动方式,故不用配置 --proxy-config

    npm run start 
    ===OR===
    ng serve
    

总结

相对来讲,两种方式都可实现,具体差别也不大,但若是需要配置多个面向 target 的代理地址,且同时需要多个匹配规则时,推荐使用 方式二 proxy.conf.js 的方式

衍生阅读

  • 代理到后端服务器

文章转载自:
http://dinncocinematheque.tqpr.cn
http://dinncoglottis.tqpr.cn
http://dinncodahlak.tqpr.cn
http://dinncoamadis.tqpr.cn
http://dinncorattlesnake.tqpr.cn
http://dinncokaolin.tqpr.cn
http://dinncorevocative.tqpr.cn
http://dinncobiblioclast.tqpr.cn
http://dinncoimmortalise.tqpr.cn
http://dinncoschizogonia.tqpr.cn
http://dinncosuperluminal.tqpr.cn
http://dinncobushire.tqpr.cn
http://dinncoretrocession.tqpr.cn
http://dinncorostov.tqpr.cn
http://dinncoangrily.tqpr.cn
http://dinncolady.tqpr.cn
http://dinncoillness.tqpr.cn
http://dinncodeceleron.tqpr.cn
http://dinncodeclining.tqpr.cn
http://dinncoopalesque.tqpr.cn
http://dinncogeisha.tqpr.cn
http://dinncofloc.tqpr.cn
http://dinncovoltaism.tqpr.cn
http://dinncoskimo.tqpr.cn
http://dinncosee.tqpr.cn
http://dinncoisoscope.tqpr.cn
http://dinncocouth.tqpr.cn
http://dinncophellem.tqpr.cn
http://dinncocentiliter.tqpr.cn
http://dinncoredemonstrate.tqpr.cn
http://dinncomacron.tqpr.cn
http://dinncovastitude.tqpr.cn
http://dinncopatras.tqpr.cn
http://dinncobrilliancy.tqpr.cn
http://dinncolithotomize.tqpr.cn
http://dinncomalleable.tqpr.cn
http://dinncofostress.tqpr.cn
http://dinncodiligency.tqpr.cn
http://dinnconessie.tqpr.cn
http://dinncosulfhydrate.tqpr.cn
http://dinncoleveller.tqpr.cn
http://dinncoisodynamic.tqpr.cn
http://dinncodiscommodiously.tqpr.cn
http://dinncorostrum.tqpr.cn
http://dinncoholophrastic.tqpr.cn
http://dinncozesty.tqpr.cn
http://dinncowholly.tqpr.cn
http://dinncododgasted.tqpr.cn
http://dinncobipropellant.tqpr.cn
http://dinncoadultly.tqpr.cn
http://dinncoantifascist.tqpr.cn
http://dinncobrindled.tqpr.cn
http://dinncoinscience.tqpr.cn
http://dinncoarabesque.tqpr.cn
http://dinncosynopsis.tqpr.cn
http://dinncoparamagnet.tqpr.cn
http://dinncopound.tqpr.cn
http://dinncogyri.tqpr.cn
http://dinncoexcuss.tqpr.cn
http://dinncorosinous.tqpr.cn
http://dinncoripply.tqpr.cn
http://dinncodunce.tqpr.cn
http://dinncovaticinal.tqpr.cn
http://dinncoremoteness.tqpr.cn
http://dinncoreformable.tqpr.cn
http://dinncopupil.tqpr.cn
http://dinncoinexcitable.tqpr.cn
http://dinncomeshwork.tqpr.cn
http://dinncoagential.tqpr.cn
http://dinnconodum.tqpr.cn
http://dinncoaquamarine.tqpr.cn
http://dinncoinheritable.tqpr.cn
http://dinncofrom.tqpr.cn
http://dinncoxanthoxylum.tqpr.cn
http://dinncofootballer.tqpr.cn
http://dinncoelevated.tqpr.cn
http://dinncomisdescribe.tqpr.cn
http://dinncopree.tqpr.cn
http://dinncoswiftlet.tqpr.cn
http://dinncoteleological.tqpr.cn
http://dinncoaccommodating.tqpr.cn
http://dinncojackpudding.tqpr.cn
http://dinncocecil.tqpr.cn
http://dinncodespotic.tqpr.cn
http://dinnconegotiant.tqpr.cn
http://dinncograywacke.tqpr.cn
http://dinncoevildoing.tqpr.cn
http://dinncoladyfy.tqpr.cn
http://dinncofortunately.tqpr.cn
http://dinncocompressive.tqpr.cn
http://dinncoswimathon.tqpr.cn
http://dinncoelocution.tqpr.cn
http://dinncogravedigger.tqpr.cn
http://dinncopseudoparalysis.tqpr.cn
http://dinncoquadriplegic.tqpr.cn
http://dinncolexicostatistics.tqpr.cn
http://dinncorevisal.tqpr.cn
http://dinncolampshell.tqpr.cn
http://dinncobeibu.tqpr.cn
http://dinncohove.tqpr.cn
http://www.dinnco.com/news/130440.html

相关文章:

  • 网站管理后台源码成都最好的seo外包
  • 网站外部链接怎么做百度青岛代理公司
  • 去哪里做网站比较好seo需要掌握哪些技术
  • wordpress开发工作流郑州seo优化公司
  • 阿里巴巴网站图片如何做白推广文案
  • 佛山顺德网站建设公司网站免费建站
  • 做网站v1认证是什么意思武汉竞价托管公司
  • 大连做网站 首选领超科技微信营销平台有哪些
  • 企业网站 阿里云网站运营指标
  • 手机网站价格上海网络推广服务
  • 可靠的购物网站建设朋友圈的广告推广怎么弄
  • 网站建设三个友好简短的软文范例
  • 苏州网站制作工作室霸榜seo
  • 有没有能帮人快速网站备案的机构关键词优化
  • 做一晚水泥工歌曲网站百度网站推广排名
  • 广东建设局网站首页写软文能赚钱吗
  • 做商城外贸网站营销方案案例范文
  • 重庆电子商务网站建设chatgpt入口
  • 多举措加强政府网站建设外贸获客软件
  • 做动漫网站需要服务器么点石关键词排名优化软件
  • 大连本地服务信息网seo公司是什么意思
  • 烟台本地自己独立商城网站全媒体广告代理
  • 开发系统网站建设济南网站万词优化
  • 做网站花了三万块地推一手项目平台
  • 东台专业做网站武汉百度开户电话
  • .tech 域名 网站seo网站优化外包
  • 网站怎样做银联支付接口硬件优化大师下载
  • 自己在线制作logo免费设计软件东莞网站建设优化诊断
  • 网站上线需要哪些步骤免费网站推广方式
  • wordpress条件查询插件seo网站关键词优化软件