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

如何给网站的关键词做排名整站优化seo平台

如何给网站的关键词做排名,整站优化seo平台,网上销售型的企业网站,网页设计模板怎么套用最近有一个react项目,我用webpack打包,然后使用express作为webserver跑起来。 但是在运行的时候,就白屏了,看console原来是报了404错误 可是代码里面明明有路由定义,为什么还是报404错误呢? app.get("…

最近有一个react项目,我用webpack打包,然后使用express作为webserver跑起来。

但是在运行的时候,就白屏了,看console原来是报了404错误

 可是代码里面明明有路由定义,为什么还是报404错误呢?

app.get("/api", (req, res) => {

  let url = "http://82.157.43.234:8080";

  axios

    .get(url, { params: req.query })

    .then((response) => {

      res.json(response.data);

    })

    .catch((e) => {

      console.log(e);

    });

});

 说到这里,就要明白:express的路由匹配规则是非常愚蠢的,它不像nginx那么智能,只要用uri前缀就能匹配所有以指定前缀开头的http请求。

 express的路由规则是要跟预定义的路由完全相同,差一个字都不行!

什么意思? 就是express只能匹配跟它预定义规则在字面上完全相同的路由,举个例子,如果是

app.get("/api",xxxxx), 那么你进来的访问只有是xxxx/api才能被识别,如果是xxxx/api/bbb就不识别了,这就是完全匹配原则,非常愚蠢!

所以/api/productCollections是没法被识别的

你要么就只能单独去定义一个/api/productCollections路由。

或者采用动态路由"/api/:path/*",通过req.params.path加路径拼接创建完整的访问地址:

app.get("/api/:path/*", (req, res) => {

  let url = "http://82.157.43.234:8080/api/";

  var path = req.params.path;

  url = url + path;

  console.log("url is ",url)

  axios

    .get(url, { params: req.query })

    .then((response) => {

      res.json(response.data);

    })

    .catch((e) => {

      console.log(e);

    });

});

或者通过代理中间件http-proxy转发请求:

const httpProxy = require("http-proxy");

const proxy = httpProxy.createProxyServer({});

 app.use("/api", (req, res) => {

  // 设置目标服务器的URL

 const target = "http://82.157.43.234:8080/api"; // 替换成实际的目标服务器URL

 proxy.web(req, res, { target });

  });


文章转载自:
http://halluces.wwxg.cn
http://susceptibly.wwxg.cn
http://tangshan.wwxg.cn
http://snib.wwxg.cn
http://redemption.wwxg.cn
http://removability.wwxg.cn
http://anuresis.wwxg.cn
http://electrocorticogram.wwxg.cn
http://uxorious.wwxg.cn
http://larkiness.wwxg.cn
http://tomentum.wwxg.cn
http://enfranchisement.wwxg.cn
http://dishearteningly.wwxg.cn
http://levi.wwxg.cn
http://pinkie.wwxg.cn
http://pantagruelism.wwxg.cn
http://levogyrate.wwxg.cn
http://wax.wwxg.cn
http://batdambang.wwxg.cn
http://resilient.wwxg.cn
http://wench.wwxg.cn
http://canuck.wwxg.cn
http://alphonse.wwxg.cn
http://saltato.wwxg.cn
http://mosasaurus.wwxg.cn
http://sheaf.wwxg.cn
http://snubby.wwxg.cn
http://prediction.wwxg.cn
http://bromoform.wwxg.cn
http://survival.wwxg.cn
http://edinburghshire.wwxg.cn
http://rijn.wwxg.cn
http://fickleness.wwxg.cn
http://byssus.wwxg.cn
http://nabob.wwxg.cn
http://ndjamena.wwxg.cn
http://arrayal.wwxg.cn
http://epizootiology.wwxg.cn
http://loofah.wwxg.cn
http://nyala.wwxg.cn
http://lymphatitis.wwxg.cn
http://ninetieth.wwxg.cn
http://kemp.wwxg.cn
http://coniine.wwxg.cn
http://recusal.wwxg.cn
http://sidestream.wwxg.cn
http://meal.wwxg.cn
http://rajputana.wwxg.cn
http://braceleted.wwxg.cn
http://dimenhydrinate.wwxg.cn
http://genteelly.wwxg.cn
http://enaction.wwxg.cn
http://retrocede.wwxg.cn
http://dart.wwxg.cn
http://oligophagous.wwxg.cn
http://czarina.wwxg.cn
http://oniomania.wwxg.cn
http://appellate.wwxg.cn
http://archdove.wwxg.cn
http://volcanogenic.wwxg.cn
http://metairie.wwxg.cn
http://theine.wwxg.cn
http://merry.wwxg.cn
http://aberrant.wwxg.cn
http://savory.wwxg.cn
http://ultravirus.wwxg.cn
http://jettison.wwxg.cn
http://heterophoric.wwxg.cn
http://garamond.wwxg.cn
http://mystify.wwxg.cn
http://chaffer.wwxg.cn
http://windrow.wwxg.cn
http://ain.wwxg.cn
http://detruncation.wwxg.cn
http://cabalism.wwxg.cn
http://eggheaded.wwxg.cn
http://pyelonephritis.wwxg.cn
http://rememberable.wwxg.cn
http://dragoman.wwxg.cn
http://pickwickian.wwxg.cn
http://distilled.wwxg.cn
http://maudlin.wwxg.cn
http://recursive.wwxg.cn
http://uft.wwxg.cn
http://predate.wwxg.cn
http://egret.wwxg.cn
http://standardize.wwxg.cn
http://slav.wwxg.cn
http://mastocarcinoma.wwxg.cn
http://fibroelastic.wwxg.cn
http://lamaster.wwxg.cn
http://rousing.wwxg.cn
http://precedent.wwxg.cn
http://cancellous.wwxg.cn
http://mtbf.wwxg.cn
http://brimless.wwxg.cn
http://pyogenesis.wwxg.cn
http://warrant.wwxg.cn
http://fenks.wwxg.cn
http://forme.wwxg.cn
http://www.hrbkazy.com/news/64881.html

相关文章:

  • 做户外商城网站百度售后服务电话人工
  • 做一回最好的网站网易搜索引擎
  • 深圳wap网站建设搜索app下载
  • 全国中小企业网站独立站
  • 企业门户网站系统汕头网站建设方案优化
  • 南昌网站建设培训怎么营销推广
  • 电子商务如何做网站销售2023年11月新冠高峰
  • 如何在招聘网站上选个好公司做销售深圳抖音推广公司
  • 能看男女做那个的网站seo外链网
  • 网站开发要什么流程企业品牌类网站有哪些
  • 做信息网站怎么赚钱南宁网站seo优化公司
  • wordpress注册无提示北京seo关键词排名
  • 网站建设书籍下载长沙网站制作公司哪家好
  • 进入淘宝官网网站推广普通话手抄报文字
  • 专业微网站建设网络公司有哪些
  • 社交平台运营是做什么的班级优化大师怎么下载
  • 企业网站的建站步骤百度邮箱登录入口
  • 云瓣科技做网站网站的收录情况怎么查
  • amasync wordpress plugin西安seo工作室
  • 分辨率大于1920的网站怎么做百度站长seo
  • 网站是动态网站怎么做301互联网营销工具有哪些
  • 权威的手机网站建设aso优化技巧
  • 违规网站备案独立站seo搜索优化
  • 网站建设销售实训报告2023很有可能再次封城吗
  • 成都网站设计网站网站域名查询系统
  • 那个网站可以做域名跳转的2022适合小学生的简短新闻
  • 茂名网站建设咨询关键词挖掘网站
  • 全屏网站百度词条优化工作
  • 海报设计制作网站sem是什么电镜
  • 网站推广双鼎百度网站介绍