diff options
| author | otofune <otofune@gmail.com> | 2017-11-14 05:26:27 +0900 |
|---|---|---|
| committer | otofune <otofune@gmail.com> | 2017-11-14 05:28:44 +0900 |
| commit | 28d2d38fce7012c6f9d48dc52a0bf2efd1e8c652 (patch) | |
| tree | 0ab13e7f967193086324d1779b53711f68d0c45a /src/api/server.ts | |
| parent | format (diff) | |
| download | sharkey-28d2d38fce7012c6f9d48dc52a0bf2efd1e8c652.tar.gz sharkey-28d2d38fce7012c6f9d48dc52a0bf2efd1e8c652.tar.bz2 sharkey-28d2d38fce7012c6f9d48dc52a0bf2efd1e8c652.zip | |
server - multerがテンポラリディレクトリにファイルを展開するように
DiskStorageをオプション無しで呼ぶといい感じになる
またチェーンを改行するようにし、デバッグ表示にパスが出るようにした
Diffstat (limited to 'src/api/server.ts')
| -rw-r--r-- | src/api/server.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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)) |