# 🔥 Azure VM + Docker + Live HackerNews API LIVE

🖥️ Linux VM Terminal
root@azure:~$
📝 Azure Function Code
// Azure Function that fetches LIVE HackerNews data async function hackerNewsFunction(context, req) { const https = require('https'); // Helper function to make HTTPS requests function httpsGet(url) { return new Promise((resolve, reject) => { https.get(url, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => resolve(JSON.parse(data))); res.on('error', reject); }).on('error', reject); }); } try { // Fetch top stories from HackerNews const topStories = await httpsGet('https://hacker-news.firebaseio.com/v0/topstories.json'); const storyIds = topStories.slice(0, 10); // Fetch details for each story const stories = await Promise.all( storyIds.map(id => httpsGet(`https://hacker-news.firebaseio.com/v0/item/${id}.json`) ) ); // Format the response const formattedStories = stories.map(story => ({ title: story.title, score: story.score, by: story.by, time: new Date(story.time * 1000).toISOString(), url: story.url, comments: story.descendants || 0 })); context.res = { status: 200, body: { success: true, timestamp: new Date().toISOString(), source: 'HackerNews Live API', count: formattedStories.length, stories: formattedStories } }; } catch (error) { context.res = { status: 500, body: { error: error.message } }; } }
🚀 Control Panel
📊 Live Metrics
0
API Calls
0
Stories Fetched
0ms
Latency
0s
Uptime
🌐 API Response

    Waiting for execution...

📰 Live HackerNews Top Stories