0
我在Heroku上部署了一個React網絡應用程序(帶有Flask API後端)。在開發過程中,在本地主機上,我的公共資產顯示得很好,例如favicon。但是,一旦我部署到Heroku,資產就不會顯示出來。該應用通過返回index.html頁面來解析請求,即不是返回favicon的ico或png,而是返回text/html文件。React Heroku上的應用程序未提供公共目錄中的資源
我的目錄結構是這樣的:
client/public/
index.html
favicon/
manifest.json
favicon.ico
favicon-16x16.png
...
這就是我怎樣,我想引用他們在我index.html
文件的<head>
:
<link rel="manifest" href="%PUBLIC_URL%/favicon/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon/favicon.ico">
我在做什麼錯?