This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import fs from 'fs'; | |
import FormData from 'form-data'; | |
async function uploadToCDN(filePath) { | |
try { | |
const formData = new FormData(); | |
formData.append('file', fs.createReadStream(filePath)); | |
const response = await axios.post('https://cdn.nekohime.site/upload', formData, { | |
headers: { |