Spaces:
Runtime error
Runtime error
| import "dotenv/config"; | |
| import { uploadArtifact, getArtifactDownloadUrl } from "../src/lib/s3-artifacts"; | |
| async function main() { | |
| const key = `test/hello-${Date.now()}.txt`; | |
| await uploadArtifact({ | |
| key, | |
| body: "Hello from AWS S3!", | |
| contentType: "text/plain", | |
| }); | |
| const url = await getArtifactDownloadUrl(key); | |
| console.log("Uploaded:", key); | |
| console.log("Temporary URL:", url); | |
| } | |
| main().catch((error) => { | |
| console.error(error); | |
| process.exit(1); | |
| }); |