UNPKG

postflame

Version:

🔥 Generate Postman collections automatically from Hono + Zod routes.

17 lines (16 loc) 548 B
import axios from 'axios'; export async function uploadToPostman(collection, apiKey) { try { const res = await axios.post('https://api.getpostman.com/collections', { collection }, { headers: { 'X-Api-Key': apiKey, 'Content-Type': 'application/json' } }); console.log(`🚀 Collection uploaded to Postman: ${res.data.collection.uid}`); return res.data; } catch (err) { console.error('❌ Failed to upload to Postman:', err.message); } }