Skip to content

Instantly share code, notes, and snippets.

View Galang-Purnama's full-sized avatar
🏠
Working from home

Galang Purnama Galang-Purnama

🏠
Working from home
View GitHub Profile
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: {