feat: add /api/dashboard endpoint with hero match, stats, streak, nudges
Returns next tippable match (hero), user rank/points from leaderboard, consecutive-tip streak, and up to 3 contextual nudges in one request. Mounts at /api/dashboard; adds getDashboard() + DashboardData type to the frontend API client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import leaderboardRouter from './routes/leaderboard';
|
||||
import adminRouter from './routes/admin';
|
||||
import profileRouter from './routes/profile';
|
||||
import devRouter from './routes/dev';
|
||||
import dashboardRouter from './routes/dashboard';
|
||||
|
||||
const app = express();
|
||||
const PORT = parseInt(process.env.PORT ?? '3001');
|
||||
@@ -126,6 +127,7 @@ app.use('/api/tips', tipsRouter);
|
||||
app.use('/api/leaderboard', leaderboardRouter);
|
||||
app.use('/api/admin', adminRouter);
|
||||
app.use('/api/profile', profileRouter);
|
||||
app.use('/api/dashboard', dashboardRouter);
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
app.use('/api/dev', devRouter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user