remove-upload-api
This commit is contained in:
parent
12f30b29a0
commit
24e15e5532
|
@ -30,7 +30,6 @@
|
||||||
"vercel-build": "astro build"
|
"vercel-build": "astro build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.178.0",
|
|
||||||
"mailgun.js": "^8.0.1"
|
"mailgun.js": "^8.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
import { createReadStream } from 'fs'
|
|
||||||
// import { S3Client, type S3ClientConfig, PutObjectCommand } from '@aws-sdk/client-s3'
|
|
||||||
import S3Client, { ClientConfiguration } from 'aws-sdk/clients/s3'
|
|
||||||
|
|
||||||
// const accessKeyId = process.env.ACCESS_KEY
|
|
||||||
// const secretAccessKey = process.env.SECRET_KEY
|
|
||||||
|
|
||||||
const config: ClientConfiguration = {
|
|
||||||
apiVersion: '2006-03-01',
|
|
||||||
region: 'eu-east-1'
|
|
||||||
}
|
|
||||||
const s3 = new S3Client(config)
|
|
||||||
|
|
||||||
export default async function handler(req, res) {
|
|
||||||
const params = {
|
|
||||||
Bucket: process.env.S3_BUCKET || 'discours-io',
|
|
||||||
Key: 'file-name', // FIXME
|
|
||||||
Body: createReadStream('file-path') // FIXME
|
|
||||||
}
|
|
||||||
// FIXME await s3.send(new PutObjectCommand(params))
|
|
||||||
res.status(200).json() // FIXME
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user