diff options
Diffstat (limited to 'server/lib/uploadx.ts')
-rw-r--r-- | server/lib/uploadx.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts new file mode 100644 index 000000000..36f5a556c --- /dev/null +++ b/server/lib/uploadx.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import express from 'express' | ||
2 | import { getResumableUploadPath } from '@server/helpers/upload' | ||
3 | import { Uploadx } from '@uploadx/core' | ||
4 | |||
5 | const uploadx = new Uploadx({ | ||
6 | directory: getResumableUploadPath(), | ||
7 | // Could be big with thumbnails/previews | ||
8 | maxMetadataSize: '10MB' | ||
9 | }) | ||
10 | uploadx.getUserId = (_, res: express.Response) => res.locals.oauth?.token.user.id | ||
11 | |||
12 | export { | ||
13 | uploadx | ||
14 | } | ||