This commit is contained in:
Patryk Koreń
2026-07-09 21:11:29 +02:00
parent 65303e655b
commit fa9e3b5ce7
10 changed files with 188 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import { createClient, type BufferLike } from "webdav";
import { createClient } from "webdav";
import fs from "fs/promises";
import path from "path";

View File

@@ -4,13 +4,9 @@ import type { Request, Response, NextFunction } from "express";
export function authMiddleware(req: Request, res: Response, next: NextFunction) {
try {
const token = req.cookies.token;
if (!token) { return res.sendStatus(401); }
console.log("Token: ", token)
console.log("Secret: ", process.env.JWT_SECRET)
jwt.verify(token, process.env.JWT_SECRET!)
next();
} catch {

View File

@@ -25,10 +25,10 @@ router.get("/video", async (req, res) => {
router.post("/createclip", async (req, res) => {
try {
encodeFrames({
await encodeFrames({
inputPattern: `${LOCAL_DIR}/*.jpg`,
output: path.resolve("./out.mp4"),
fps: 12,
fps: 8,
});
res.status(200).end();
} catch {