generated from fahricansecer/boilerplate-fe
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Has been cancelled
14 lines
420 B
JavaScript
14 lines
420 B
JavaScript
import https from 'https';
|
|
import fs from 'fs';
|
|
|
|
const file = fs.createWriteStream("public/hero-bg.jpg");
|
|
https.get("https://drive.google.com/uc?export=download&id=1YVWlLN4_6B4aVQ5BMeK72wpJyB4Az5T9", function(response) {
|
|
if (response.statusCode === 302 || response.statusCode === 303) {
|
|
https.get(response.headers.location, function(res) {
|
|
res.pipe(file);
|
|
});
|
|
} else {
|
|
response.pipe(file);
|
|
}
|
|
});
|