diff --git a/server/src/workflow-management/storage.ts b/server/src/workflow-management/storage.ts new file mode 100644 index 00000000..cc366b55 --- /dev/null +++ b/server/src/workflow-management/storage.ts @@ -0,0 +1,19 @@ +/** + * A group of functions for storing recordings on the file system. + * Functions are asynchronous to unload the server from heavy file system operations. + */ +import fs from 'fs'; +import * as path from "path"; + +export const readFile = (path: string): Promise => { + return new Promise((resolve, reject) => { + fs.readFile(path, 'utf8', (err, data) => { + if (err) { + reject(err); + } else { + resolve(data); + } + }); + }); +}; +