Started adding the Amazon S3 Chunk Service, so far Uploading, Downloading, and Streaming video works
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user