aboutsummaryrefslogtreecommitdiff
path: root/src/files.ts
diff options
context:
space:
mode:
authorcjd242018-04-19 21:01:12 +0100
committercjd242018-04-19 21:01:12 +0100
commit1416af119d500ea6e7983262a7ebab3ab35c0500 (patch)
treeba7f6d4b86cc0eb1ec35c407ed59af4af90e996c /src/files.ts
parentMerge branch 'cjd24/conversion' of https://gitlab.cs.st-andrews.ac.uk/cs3099g... (diff)
parentfixed test-crash (diff)
downloadmedicine-1416af119d500ea6e7983262a7ebab3ab35c0500.tar.gz
medicine-1416af119d500ea6e7983262a7ebab3ab35c0500.zip

adding trh/gets into mine to get the additional CORS stuff

Diffstat (limited to 'src/files.ts')
-rw-r--r--src/files.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/files.ts b/src/files.ts
index 5b15a10..e87d8da 100644
--- a/src/files.ts
+++ b/src/files.ts
@@ -32,12 +32,20 @@ const readableStream: (filename: string, projectName: string, { offset, length }
return fs.createReadStream(path(filename, projectName), options);
};
-const logPath: (type: string, projectName?: string) => string = (
+export function logPath (type: string, projectName?: string){
+ return projectName
+ ? `${LOG_BASE_DIRECTORY}/projects/${projectName}/${type}`
+ : `${LOG_BASE_DIRECTORY}/general/${type}`;
+}
+
+/*
+export const logPath: (type: string, projectName?: string) => string = (
type: string, projectName?: string): string => {
return projectName
? `${LOG_BASE_DIRECTORY}/projects/${projectName}/${type}`
: `${LOG_BASE_DIRECTORY}/general/${type}`;
};
+*/
let storage = Multer.diskStorage({
destination: function (req, file, cb) {