uploads test
This commit is contained in:
parent
29bc2b8ddd
commit
dabbc7d862
11 changed files with 121 additions and 44 deletions
19
client/player.js
Normal file
19
client/player.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
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 videoData = await db.all('SELECT * FROM video WHERE id = ?', [
|
||||
req.query.id
|
||||
]);
|
||||
videoData = videoData[0];
|
||||
return res.render('player', {
|
||||
username,
|
||||
videoData
|
||||
});
|
||||
});
|
||||
|
||||
export default main;
|
19
client/upload.js
Normal file
19
client/upload.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import Route from "../route.js";
|
||||
import auth from "../form/auth.js";
|
||||
|
||||
// TODO: rewrite
|
||||
let main = new Route([auth], async function (req, res, input) {
|
||||
let { username } = input;
|
||||
return res.render('form', {
|
||||
data: [
|
||||
{ label: "Video file", type: "file", name: "file" },
|
||||
{ label: "Name", type: "text", name: "title" },
|
||||
{ label: "Description", type: "text", name: "desc" }
|
||||
],
|
||||
'route': '/api/upload/upload',
|
||||
'title': 'Upload Content',
|
||||
username
|
||||
});
|
||||
});
|
||||
|
||||
export default main;
|
Loading…
Add table
Add a link
Reference in a new issue