Support for additional S3 providers (#71)

* support for other s3 providers

* remove redundant route options

* use type safe env

* prettier
This commit is contained in:
Mert Demir
2024-02-01 07:00:19 +09:00
committed by GitHub
parent e6467b41fc
commit 08d75fd75c
5 changed files with 35 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import { randomId } from '@/lib/api'
import { env } from '@/lib/env'
import { POST as route } from 'next-s3-upload/route'
export const POST = route.configure({
@@ -8,4 +9,7 @@ export const POST = route.configure({
const random = randomId()
return `document-${timestamp}-${random}${extension.toLowerCase()}`
},
endpoint: env.S3_UPLOAD_ENDPOINT,
// forcing path style is only necessary for providers other than AWS
forcePathStyle: !!env.S3_UPLOAD_ENDPOINT,
})