From 28d2d38fce7012c6f9d48dc52a0bf2efd1e8c652 Mon Sep 17 00:00:00 2001 From: otofune Date: Tue, 14 Nov 2017 05:26:27 +0900 Subject: server - multerがテンポラリディレクトリにファイルを展開するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DiskStorageをオプション無しで呼ぶといい感じになる またチェーンを改行するようにし、デバッグ表示にパスが出るようにした --- src/api/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/api/server.ts') diff --git a/src/api/server.ts b/src/api/server.ts index 3de32d9eab..026357b465 100644 --- a/src/api/server.ts +++ b/src/api/server.ts @@ -40,7 +40,7 @@ app.get('/', (req, res) => { endpoints.forEach(endpoint => endpoint.withFile ? app.post(`/${endpoint.name}`, - endpoint.withFile ? multer({ dest: 'uploads/' }).single('file') : null, + endpoint.withFile ? multer({ storage: multer.diskStorage({}) }).single('file') : null, require('./api-handler').default.bind(null, endpoint)) : app.post(`/${endpoint.name}`, require('./api-handler').default.bind(null, endpoint)) -- cgit v1.2.3-freya