17 lines
No EOL
410 B
JavaScript
17 lines
No EOL
410 B
JavaScript
import Route from "../route.js";
|
|
import auth from "../form/auth.js";
|
|
import initDb from "../db.js";
|
|
|
|
let db = await initDb();
|
|
|
|
let main = new Route([auth], async function (req, res, input) {
|
|
let { username } = input;
|
|
let videos = await db.all('SELECT * FROM video ORDER BY date DESC LIMIT 10', [
|
|
]);
|
|
return res.render('main', {
|
|
username,
|
|
videos
|
|
});
|
|
});
|
|
|
|
export default main; |