bigly-chat/client/player.js

21 lines
501 B
JavaScript
Raw Normal View History

2024-11-25 14:12:43 -05:00
import Route from "../route.js";
2024-11-25 14:12:43 -05:00
import comment from "./comment.js";
2024-11-25 14:12:43 -05:00
import initDb from "../db.js";
let db = await initDb();
2024-11-25 14:12:43 -05:00
let main = new Route([comment], async function (req, res, input) {
2024-11-25 14:12:43 -05:00
let videoData = await db.all('SELECT * FROM video WHERE id = ?', [
req.query.id
]);
2024-11-25 14:12:44 -05:00
if (videoData.length == 0) return;
2024-11-25 14:12:43 -05:00
videoData = videoData[0];
2024-11-25 14:12:44 -05:00
res.render('player', {
2024-11-25 14:12:43 -05:00
...input,
2024-11-25 14:12:44 -05:00
videoData,
ogType: 'video'
2024-11-25 14:12:43 -05:00
});
2024-11-25 14:12:44 -05:00
return true;
2024-11-25 14:12:43 -05:00
});
export default main;