Monorepo for Aesthetic.Computer aesthetic.computer
at main 26 lines 736 B view raw
1#!/usr/bin/env node 2import fs from 'fs'; 3import path from 'path'; 4import os from 'os'; 5 6const authPath = path.join(os.homedir(), '.ac-token'); 7const auth = JSON.parse(fs.readFileSync(authPath, 'utf8')); 8 9process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; 10 11const piece = process.argv[2] || '64i'; 12console.log(`Testing mint of $${piece}...`); 13 14const response = await fetch('https://localhost:8888/api/keep-mint', { 15 method: 'POST', 16 headers: { 17 'Authorization': `Bearer ${auth.access_token}`, 18 'Content-Type': 'application/json', 19 'Accept': 'text/event-stream', 20 }, 21 body: JSON.stringify({ piece, mode: 'mint' }), 22}); 23 24console.log('Status:', response.status); 25const text = await response.text(); 26console.log('Response:', text);