1
0
Fork 0
peertube/server/lib/uploadx.ts

19 lines
445 B
TypeScript
Raw Normal View History

import express from 'express'
import { getResumableUploadPath } from '@server/helpers/upload'
import { Uploadx } from '@uploadx/core'
2021-12-17 14:49:52 +00:00
const uploadx = new Uploadx({
directory: getResumableUploadPath(),
// Could be big with thumbnails/previews
2022-01-18 08:29:46 +00:00
maxMetadataSize: '10MB',
userIdentifier: (_, res: express.Response) => {
if (!res.locals.oauth) return undefined
return res.locals.oauth.token.user.id + ''
}
2021-12-17 14:49:52 +00:00
})
export {
uploadx
}