bigly-chat/client/player.js
2024-11-25 08:24:18 -05:00

21 lines
No EOL
501 B
JavaScript

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
]);
if (videoData.length == 0) return;
videoData = videoData[0];
res.render('player', {
...input,
videoData,
ogType: 'video'
});
return true;
});
export default main;