• <legend id='rQcjO'><style id='rQcjO'><dir id='rQcjO'><q id='rQcjO'></q></dir></style></legend>

      <tfoot id='rQcjO'></tfoot>

      <i id='rQcjO'><tr id='rQcjO'><dt id='rQcjO'><q id='rQcjO'><span id='rQcjO'><b id='rQcjO'><form id='rQcjO'><ins id='rQcjO'></ins><ul id='rQcjO'></ul><sub id='rQcjO'></sub></form><legend id='rQcjO'></legend><bdo id='rQcjO'><pre id='rQcjO'><center id='rQcjO'></center></pre></bdo></b><th id='rQcjO'></th></span></q></dt></tr></i><div id='rQcjO'><tfoot id='rQcjO'></tfoot><dl id='rQcjO'><fieldset id='rQcjO'></fieldset></dl></div>

      <small id='rQcjO'></small><noframes id='rQcjO'>

        <bdo id='rQcjO'></bdo><ul id='rQcjO'></ul>

      1. Fetch 返回我自己的 index.html 的 html 源

        Fetch returns html source of the my own index.html(Fetch 返回我自己的 index.html 的 html 源)
      2. <tfoot id='Nae9f'></tfoot>
      3. <legend id='Nae9f'><style id='Nae9f'><dir id='Nae9f'><q id='Nae9f'></q></dir></style></legend>
        <i id='Nae9f'><tr id='Nae9f'><dt id='Nae9f'><q id='Nae9f'><span id='Nae9f'><b id='Nae9f'><form id='Nae9f'><ins id='Nae9f'></ins><ul id='Nae9f'></ul><sub id='Nae9f'></sub></form><legend id='Nae9f'></legend><bdo id='Nae9f'><pre id='Nae9f'><center id='Nae9f'></center></pre></bdo></b><th id='Nae9f'></th></span></q></dt></tr></i><div id='Nae9f'><tfoot id='Nae9f'></tfoot><dl id='Nae9f'><fieldset id='Nae9f'></fieldset></dl></div>
        1. <small id='Nae9f'></small><noframes id='Nae9f'>

            <tbody id='Nae9f'></tbody>

          • <bdo id='Nae9f'></bdo><ul id='Nae9f'></ul>

                  本文介绍了Fetch 返回我自己的 index.html 的 html 源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 react-create-app 服务器(localhost:3000) 中使用 fetch 从我的 apache(localhost:80) 获取静态 .json 文件,但它返回我的 react index.html 文件的源代码!

                  I am trying to use fetch in an react-create-app server(localhost:3000) to get a static .json file from my apache(localhost:80) but it returns source of my react index.html file!

                  指定端口号会导致网络错误"

                  Specifying port number results in "networking error"

                  const that=this;
                  fetch("localhost/myapp/data/structure.json").then((res)=> {return res.text()})
                                  .then(((data)=>{that.setState({structure: data})})).catch((e)=>{alert(e.toString())});
                  

                  推荐答案

                  问题在于使 react-create-app 与本地服务器一起工作,本指南中对此进行了说明 https://daveceddia.com/create-react-app-express-backend/

                  Downright the problem comes to making react-create-app work with a local server which is explained in this guide https://daveceddia.com/create-react-app-express-backend/

                  简而言之,我需要在我的 package.json 中放置一个值等于本地服务器地址的代理属性.就我而言:

                  In short I needed to put a proxy property with the value equal to address of my local server in my package.json. In my case:

                    "proxy": "http://localhost:80"
                  

                  这篇关于Fetch 返回我自己的 index.html 的 html 源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  业务场景:使用update语句去更新数据库字段。 原因:update接收值不正确。原来代码: $query = "UPDATE student SET date = now() WHERE id = $id";$result = $mysqli-query($query2) or die($mysqli-error); // 问题出现了在这句 $data = $result-fetch_ass
                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                    <tbody id='RYPcs'></tbody>
                  • <bdo id='RYPcs'></bdo><ul id='RYPcs'></ul>

                      <i id='RYPcs'><tr id='RYPcs'><dt id='RYPcs'><q id='RYPcs'><span id='RYPcs'><b id='RYPcs'><form id='RYPcs'><ins id='RYPcs'></ins><ul id='RYPcs'></ul><sub id='RYPcs'></sub></form><legend id='RYPcs'></legend><bdo id='RYPcs'><pre id='RYPcs'><center id='RYPcs'></center></pre></bdo></b><th id='RYPcs'></th></span></q></dt></tr></i><div id='RYPcs'><tfoot id='RYPcs'></tfoot><dl id='RYPcs'><fieldset id='RYPcs'></fieldset></dl></div>

                        1. <tfoot id='RYPcs'></tfoot>
                          <legend id='RYPcs'><style id='RYPcs'><dir id='RYPcs'><q id='RYPcs'></q></dir></style></legend>

                            <small id='RYPcs'></small><noframes id='RYPcs'>