notepilot / scripts /test-s3-upload.ts
jasonmdong's picture
Sync from GitHub via hub-sync
c057aea verified
Raw
History Blame Contribute Delete
478 Bytes
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);
});