我在我的index.js文件中拥有这些路由。
<Router history={customHistory}>
<div className="row">
<Switch>
<Route exact path="/login" component={Login}/>
<Route path="/home" component={Home}/>
<Route path="/politicas" component={Policies}/>
<Redirect exact from="/" to="/login"/>
<Route exact path="*" status={404} component={NotFound}/>
</Switch>
</div>
</Router>
在本地环境中一切正常,但我有一个Firebase应用程序,在部署我的Firebase项目时,我使用:
npm run build
和
firebase deploy
但在Firebase应用程序中进行深度刷新后返回404,唯一有效的路径是“ / ”。我该怎么做才能让所有路径始终正常工作?