【问题标题】:Why is Heroku sending me back data but my frontend is not rendering anything?为什么 Heroku 向我发回数据但我的前端没有渲染任何东西?
【发布时间】:2021-02-13 03:28:44
【问题描述】:

我将后端部署到 Heroku 并成功部署。我已经使用 Axios 将前端连接到后端,并将 baseURL 从 localhost 更改为 Heroku,但是一旦我打开应用程序,除了原始 json 数据之外什么都没有显示。

【问题讨论】:

    标签: heroku axios mern


    【解决方案1】:

    您的前端文件夹中必须有一个 manifest.json,并且它必须具有指向 index.js 的 start“start_url”,如下所示..

    {
      "short_name": "React App",
      "name": "Create React App Sample",
      "icons": [
        {
          "src": "images/favicon.ico",
          "sizes": "64x64 32x32 24x24 16x16",
          "type": "image/x-icon"
        },
        {
          "src": "images/logo.png",
          "type": "image/png",
          "sizes": "192x192"
        }
      ],
      "start_url": "./index.js",
      "display": "standalone",
      "theme_color": "#000000",
      "background_color": "#ffffff"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-29
      相关资源
      最近更新 更多