wa-dev-tools/routes/pages.js
treamz 01c31ec35b Fix: landing served at / instead of dashboard
- Renamed index.html → dashboard.html (express.static was serving index.html for /)
- / now correctly shows landing page (no logout button, no dashboard header)
- /dashboard shows dashboard.html (protected, requires auth)
- Incognito users see only landing + login/register
2026-03-22 00:04:17 +03:00

23 lines
991 B
JavaScript

const express = require('express');
const path = require('path');
const router = express.Router();
const pub = (...p) => path.join(__dirname, '..', 'public', ...p);
// Landing (public — served before auth middleware via express.static, but also as fallback route)
router.get('/', (req, res) => res.sendFile(pub('landing.html')));
// Dashboard (protected — after auth)
router.get('/dashboard', (req, res) => res.sendFile(pub('dashboard.html')));
router.get('/home', (req, res) => res.redirect('/dashboard'));
// Tools
router.get('/md', (req, res) => res.sendFile(pub('md.html')));
router.get('/editor', (req, res) => res.sendFile(pub('editor.html')));
router.get('/sanitizer', (req, res) => res.sendFile(pub('sanitizer.html')));
router.get('/converter', (req, res) => res.sendFile(pub('converter.html')));
router.get('/formatter', (req, res) => res.sendFile(pub('formatter.html')));
router.get('/password', (req, res) => res.sendFile(pub('password.html')));
module.exports = router;