From 1fa968fa485cd7253b77412cdaa66c01a8adc8eb Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Thu, 19 Apr 2018 17:18:57 +0100 Subject: Add further CORS support --- src/app.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/app.ts b/src/app.ts index 09b9e6a..d94011a 100644 --- a/src/app.ts +++ b/src/app.ts @@ -81,6 +81,7 @@ class App { 'Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept' ); + res.header('Access-Control-Allow-Methods', '*'); next(); }); } -- cgit v1.2.1 From e28cc777e4956f718e0dc6387b94b53cf6be8417 Mon Sep 17 00:00:00 2001 From: jw255 Date: Thu, 19 Apr 2018 19:47:22 +0100 Subject: fixed test-crash --- src/files.ts | 10 +++++++++- src/logger.ts | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') 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) { diff --git a/src/logger.ts b/src/logger.ts index 74ae1f7..ba66650 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -3,7 +3,7 @@ import * as colors from 'colors/safe'; import * as winston from 'winston'; -import { files } from './files'; +import { logPath } from './files'; import { QueryOptions } from 'sequelize'; type Colour = (s: string) => string; @@ -143,7 +143,7 @@ const basicFileTransport: winston.TransportInstance = silent: false, colorize: false, timestamp: true, - filename: files.logPath('basic'), + filename: './logs/general/basic',//logPath('basic'), maxSize: 1000000, maxFiles: 100, stream: undefined, @@ -170,7 +170,7 @@ const criticalFileTransport: winston.TransportInstance = silent: false, colorize: false, timestamp: true, - filename: files.logPath('critical'), + filename: './logs/general/critical' ,//logPath('critical'), maxSize: 1000000, maxFiles: 10, stream: undefined, @@ -198,7 +198,7 @@ const queryFileTransport: winston.TransportInstance = silent: false, colorize: false, timestamp: true, - filename: files.logPath('queries'), + filename: './logs/general/queries',//logPath('queries'), maxSize: 1000000, maxFiles: 100, stream: undefined, -- cgit v1.2.1