2016-05-04 82 views
1

那裏,反應路由器沒有生產

我正在使用反應路由器爲這個應用程序。它在我的本地服務器上正常工作。這裏是代碼:

var routes = (
<Router history={browserHistory}> 
    <Route path="/" component={App} /> 
    <Route path="/concepts" component={Concepts} /> 
    <Route path="/ssdb" component={SolarSystem} /> 
    <Route path="/missions" component={Missions} /> 
</Router> 
) 

但是,當我使用webpack部署到Firebase服務器,該路線不再工作。該網址顯示「此文件不存在,並且在當前目錄中找不到index.html或在根目錄中找不到404.html」。

我錯過了什麼?謝謝!

+0

控制檯中的任何錯誤? –

+0

沒有錯誤...但我們只是想出了它,它是關於firebase – Lisa

回答

1

事實證明,我們需要將重寫添加到firebase.json。希望它有助於解決其他人的類似問題。

"rewrites": [{ 
    "source": "**", 
    "destination": "/index.html" 
    }]