import { Router, Request, Response } from 'express';
import type { WordBank } from '@wordle/shared';
import { getDailyWordId } from '../daily-word.js';

export function createDailyRouter(wordBank: WordBank): Router {
  const router = Router();

  router.get('/', (_req: Request, res: Response) => {
    const wordId = getDailyWordId(wordBank.targets.length);
    res.json({ wordId });
  });

  return router;
}
