привет, у меня такая проблема: сервер не отдает index.html.
но он не отдает страничку только тогда когда путь есть "/modal/...что далее"
if (process.env.NODE_ENV === 'production') {
app.use('/', express.static('frontend/build'))
app.get('*', (req, res) => {
console.log('here')
res.sendFile(path.join(__dirname, 'frontend', 'build', 'index.html'));
})
}
здесь я отдаю страничку
const App = () => (
<Switch>
<Route path="/" exact>
<Layout>
<Main />
</Layout>
</Route>
<Route path="/about">
<Layout>
<About />
</Layout>
</Route>
<Route path="/vstup">
<Layout>
<Vstup />
</Layout>
</Route>
<Route path="/consultation">
<Layout>
<Consultation />
</Layout>
</Route>
<Route path="/galery/:id">
<Layout>
<Galery />
</Layout>
</Route>
<Route path="/open-day">
<Layout>
<OpenDay />
</Layout>
</Route>
<Route path="/structure">
<Layout>
<Structure />
</Layout>
</Route>
<Route path="/news">
<Layout>
<News />
</Layout>
</Route>
<Route path="/history-of-college">
<Layout>
<History />
</Layout>
</Route>
<Route path="/work">
<Layout>
<Work />
</Layout>
</Route>
<Route path="/day-schedule">
<Layout>
<DaySchedule />
</Layout>
</Route>
<Route path="/rights">
<Layout>
<Rights />
</Layout>
</Route>
<Route path="/replacements">
<Layout>
<Replacements />
</Layout>
</Route>
<Route path="/specialty">
<Layout>
<Specialty />
</Layout>
</Route>
<Route path="/contacts">
<Layout>
<Contacts />
</Layout>
</Route>
<Route path="/financial-report">
<Layout>
<FinancialReportContainer />
</Layout>
</Route>
<Route path="/achievements">
<Layout>
<Achievements />
</Layout>
</Route>
<Route path="/contract">
<Layout>
<Contract />
</Layout>
</Route>
<Route path="/zno">
<Layout>
<ZNO />
</Layout>
</Route>
<Route path="/public-info">
<Layout>
<PublicInfo />
</Layout>
</Route>
<Route path="/exam-schedule">
<Layout>
<ExamSchedule />
</Layout>
</Route>
<Route path="/rating">
<Layout>
<Rating />
</Layout>
</Route>
<Route path="/404">
<Layout>
<P404 />
</Layout>
</Route>
<Route path="/modal/response/:id">
<ResponseModal />
</Route>
<Route path="/modal/structure">
<StructureModal />
</Route>
<Route path="/modal/course/:part/:course">
<CourseModal />
</Route>
<Route path="/modal/unit/:subgroup">
<UnitModal />
</Route>
<Route path="/modal/award/:year">
<AwardModal />
</Route>
<Route path="/login">
<Layout>
<Login />
</Layout>
</Route>
<Route path="/posts/:id">
<Layout>
<FullPost />
</Layout>
</Route>
<Redirect to="/404" />
</Switch>
)
реакт роутер
<Route path="/modal/response/:id">
<ResponseModal />
</Route>
<Route path="/modal/structure">
<StructureModal />
</Route>
<Route path="/modal/course/:part/:course">
<CourseModal />
</Route>
<Route path="/modal/unit/:subgroup">
<UnitModal />
</Route>
<Route path="/modal/award/:year">
<AwardModal />
</Route>
именно на этих роутах он не отдает страничку. почему?