import Route from "../route.js";
import comment from "./comment.js";
import initDb from "../db.js";

let db = await initDb();

let main = new Route([comment], async function (req, res, input) {
    let videoData = await db.all('SELECT * FROM video WHERE id = ?', [
        req.query.id
    ]);
    videoData = videoData[0];
    return res.render('player', {
        ...input,
        videoData
    });
});

export default main;