Fix Express middleware order to resolve homepage routing issue
- Move express.static middleware after custom routes - This prevents index.html from being served on / route - Now homepage correctly shows SaaS platform instead of old counter - Static files still accessible via direct URLs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7b7892a5b2
commit
15532139f4
1 changed files with 3 additions and 1 deletions
|
|
@ -19,7 +19,6 @@ app.use(helmet({
|
|||
app.use(cors());
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
// Сессии
|
||||
app.use(session({
|
||||
|
|
@ -325,6 +324,9 @@ app.get('/api/user/stats', requireAuth, (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
// Static файлы (после пользовательских маршрутов)
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
// Инициализация приложения
|
||||
async function startApp() {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue