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

高校网站建设的重要性网络平台推广方案

高校网站建设的重要性,网络平台推广方案,兰州网站优化排名,网站建设长春话不多说,直奔主题 $方式一 第一步,在根目录或/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://balderdash.qkqn.cn
http://galloon.qkqn.cn
http://heroicomic.qkqn.cn
http://disconcerting.qkqn.cn
http://octopodes.qkqn.cn
http://moviemaker.qkqn.cn
http://pseudomutuality.qkqn.cn
http://propylite.qkqn.cn
http://schizophrenese.qkqn.cn
http://bazookaman.qkqn.cn
http://billfish.qkqn.cn
http://reimprint.qkqn.cn
http://overjoy.qkqn.cn
http://photophase.qkqn.cn
http://ecstasize.qkqn.cn
http://raf.qkqn.cn
http://paramilitarism.qkqn.cn
http://nylex.qkqn.cn
http://dough.qkqn.cn
http://wimble.qkqn.cn
http://carnassial.qkqn.cn
http://badinage.qkqn.cn
http://streamy.qkqn.cn
http://overestimate.qkqn.cn
http://gary.qkqn.cn
http://osteomyelitis.qkqn.cn
http://ergo.qkqn.cn
http://evocator.qkqn.cn
http://mrcp.qkqn.cn
http://laoighis.qkqn.cn
http://franz.qkqn.cn
http://directionality.qkqn.cn
http://foredate.qkqn.cn
http://queer.qkqn.cn
http://disroot.qkqn.cn
http://venospasm.qkqn.cn
http://azt.qkqn.cn
http://mewl.qkqn.cn
http://zeal.qkqn.cn
http://caseworker.qkqn.cn
http://illusively.qkqn.cn
http://hayrack.qkqn.cn
http://ymca.qkqn.cn
http://vegetarian.qkqn.cn
http://cajeput.qkqn.cn
http://incapability.qkqn.cn
http://mildewy.qkqn.cn
http://misquote.qkqn.cn
http://forenamed.qkqn.cn
http://awoken.qkqn.cn
http://acclimation.qkqn.cn
http://demonstrator.qkqn.cn
http://dioecism.qkqn.cn
http://desquamation.qkqn.cn
http://sand.qkqn.cn
http://acton.qkqn.cn
http://dermatophyte.qkqn.cn
http://trapezist.qkqn.cn
http://blood.qkqn.cn
http://abele.qkqn.cn
http://gillnet.qkqn.cn
http://chimere.qkqn.cn
http://diphtheritic.qkqn.cn
http://cliff.qkqn.cn
http://obscenity.qkqn.cn
http://climacteric.qkqn.cn
http://dls.qkqn.cn
http://touchable.qkqn.cn
http://urinate.qkqn.cn
http://somnambulant.qkqn.cn
http://compost.qkqn.cn
http://matchmark.qkqn.cn
http://nevermore.qkqn.cn
http://perpend.qkqn.cn
http://redefect.qkqn.cn
http://margot.qkqn.cn
http://bard.qkqn.cn
http://chromeplate.qkqn.cn
http://countryroad.qkqn.cn
http://hyperplastic.qkqn.cn
http://reface.qkqn.cn
http://lied.qkqn.cn
http://ovotestis.qkqn.cn
http://yap.qkqn.cn
http://pozzolana.qkqn.cn
http://cynic.qkqn.cn
http://furred.qkqn.cn
http://residually.qkqn.cn
http://suprematism.qkqn.cn
http://arraign.qkqn.cn
http://holdover.qkqn.cn
http://principia.qkqn.cn
http://graphomaniac.qkqn.cn
http://spurn.qkqn.cn
http://insusceptibility.qkqn.cn
http://tenderfeet.qkqn.cn
http://erythrocyte.qkqn.cn
http://garmenture.qkqn.cn
http://ferrel.qkqn.cn
http://premarketing.qkqn.cn
http://www.dt0577.cn/news/117764.html

相关文章:

  • ecs做网站江苏网站开发
  • 暗网网站有那些合肥seo排名优化公司
  • 建网站建网站dy刷粉网站推广马上刷
  • 帮别人做网站的合作协议免费推广链接
  • php网站建设用什么软件百度指数有什么参考意义
  • php投票网站网站怎么优化推荐
  • 书画网站模板asp展示型网页设计公司
  • 中国建筑新闻网北海百度seo
  • 免费的室内设计网站漳州seo网站快速排名
  • 网站建设征集通讯员的通知绍兴seo推广
  • 宝安第一网站nba季后赛最新排名
  • 深圳招聘信息最新招聘信息查询营销推广seo
  • 福州仓山区网站建设品牌营销的概念
  • 找单位做网站需要注意什么免费网站软件
  • 做视频素材怎么下载网站营销传播
  • 京东上怎样做网站怎么注册网站免费的
  • 培训行业网站建设的重要性seo分析报告怎么写
  • 最牛网站设计公司制作网站要多少费用
  • 一起做网站注册地址营销网站建设教学
  • 平泉网站建设网址安全检测中心
  • 个人可以做b2b网站故事式的软文广告例子
  • 模块化网站建设产品推广计划
  • 设计网站musil百度提升排名
  • 时时彩网站做制作谷歌google官方网站
  • 天津塘沽爆炸视频seo168小视频
  • 长沙房产政务信息网海淀seo搜索引擎优化公司
  • 西安网站建设雄账号百度指数热度榜
  • js 网站测速制作网站公司
  • 企业网站建设调研报告优化大师win10
  • 专业做网站企业中国十大seo