I have to add routes for front end as "/How-it-works" and for admin end as "Admin/Route-name", with following code it works fine and i can access with refresh as well locally but when i create build and access on server it generate an error.
<Router history={history} >
<Switch>
<FrontEndLayoutWrapper exact path="/" component={Home} />
<FrontEndLayoutWrapper exact path="/How-it-works" component={HowItWorks} />
<AdminAuthRoute exact path="/Admin" component={AdminIndex} />
<PrivateRouteAdmin exact path="/Admin/Companies" component={CompanyList} />
<PrivateRouteAdmin exact path="/Admin/Festivals" component={FestivalList} />
<PrivateRouteAdmin exact path="/Admin/Dashboard" component={Dashboard} />
</Switch>
</Router>
In webpack.config.js i have output property in module.exports as this:
output: {
path: path.join(__dirname, 'bundle'),
filename: 'index_bundle.js',
publicPath: '/',
}
and i have already set historyApiFallback to true in module.exports as well.
devServer: {
historyApiFallback: true
}
Error:
GET http://localhost:8080/Admin/index_bundle.js net::ERR_ABORTED 404 (Not Found)