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:
Claude Code 2025-09-29 11:30:17 +01:00
parent 7b7892a5b2
commit 15532139f4

View file

@ -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 {