20 lines
588 B
JavaScript
20 lines
588 B
JavaScript
const db = require('./database');
|
|
const storage = require('./storage');
|
|
|
|
async function test() {
|
|
await db.initDatabase();
|
|
await storage.loadConfigFromDb();
|
|
const url = await storage.getDownloadPresignedUrl('1779978903531_1779978896458-6xwema4i0.png');
|
|
console.log('Presigned URL:', url);
|
|
|
|
if (url) {
|
|
const fetch = require('node-fetch');
|
|
const res = await fetch(url);
|
|
console.log('Status:', res.status);
|
|
const text = await res.text();
|
|
console.log('Response body:', text.substring(0, 200));
|
|
}
|
|
}
|
|
|
|
test().catch(console.error).finally(() => process.exit(0));
|