import fetch from 'node-fetch'; // 测试从HTML内容生成海报 async function testHtmlPoster() { const testData = { html: 'Test Poster

Test HTML Content

This is a test of HTML poster generation.

', width: 800, height: 600, type: 'png', device: 1 }; try { console.log('Sending request to generate poster from HTML...'); const response = await fetch('http://localhost:3000/api/v1/poster', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer abc123' }, body: JSON.stringify(testData) }); if (response.ok) { const result = await response.json(); console.log('Success:', result); } else { console.error('Error:', response.status, await response.text()); } } catch (error) { console.error('Request failed:', error); } } // 执行测试 testHtmlPoster();