Started adding the Amazon S3 Chunk Service, so far Uploading, Downloading, and Streaming video works

This commit is contained in:
subnub
2020-04-17 01:20:54 -04:00
parent 4821c5a408
commit 4a03523c96
8 changed files with 220 additions and 10 deletions
+6 -3
View File
@@ -8,6 +8,9 @@ const fileService = new FileService()
import FileSystemService from "../services/ChunkService/FileSystemService";
const fileSystemService = new FileSystemService();
import S3FileService from "../services/ChunkService/S3Service";
const s3FileService = new S3FileService();
import {UserInterface} from "../models/user";
interface RequestType extends Request {
@@ -86,7 +89,7 @@ class FileSystemController {
req.pipe(busboy);
const file = await fileSystemService.uploadFile(user, busboy, req);
const file = await s3FileService.uploadFile(user, busboy, req);
res.send(file);
@@ -445,7 +448,7 @@ class FileSystemController {
console.log("stream request", req.params.id)
await fileSystemService.streamVideo(user, fileID, headers, res);
await s3FileService.streamVideo(user, fileID, headers, res);
} catch (e) {
@@ -472,7 +475,7 @@ class FileSystemController {
const fileID = req.params.id;
//await fileService.downloadFile(user, fileID, res);
await fileSystemService.downloadFile(user, fileID, res);
await s3FileService.downloadFile(user, fileID, res);
} catch (e) {