<?xml version="1.0" encoding="utf-8" ?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:tt="http://teletype.in/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"><title>Tural Aliyev</title><author><name>Tural Aliyev</name></author><id>https://teletype.in/atom/turalaliv</id><link rel="self" type="application/atom+xml" href="https://teletype.in/atom/turalaliv?offset=0"></link><link rel="alternate" type="text/html" href="https://teletype.in/@turalaliv?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=turalaliv"></link><link rel="next" type="application/rss+xml" href="https://teletype.in/atom/turalaliv?offset=10"></link><link rel="search" type="application/opensearchdescription+xml" title="Teletype" href="https://teletype.in/opensearch.xml"></link><updated>2026-05-26T06:55:56.117Z</updated><entry><id>turalaliv:pF2v4ipETxf</id><link rel="alternate" type="text/html" href="https://teletype.in/@turalaliv/pF2v4ipETxf?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=turalaliv"></link><title>Javascript challenge</title><published>2024-04-13T13:52:37.718Z</published><updated>2024-04-13T13:52:37.718Z</updated><summary type="html">const express = require('express'); const util = require('util'); const exec = util.promisify(require('child_process').exec); const app = express(); app.get('/network_health', async (req, res) =&gt; { const { timeout,ㅤ} = req.query; const checkCommands = [ 'ping -c 1 google.com', 'curl -s http://example.com/',ㅤ ]; try { await Promise.all(checkCommands.map(cmd =&gt; cmd &amp;&amp; exec(cmd, { timeout: +timeout || 5_000 }))); res.status(200); res.send('ok'); } catch(e) { res.status(500); res.send('failed'); } }); app.listen(8080);</summary><content type="html">
  &lt;p id=&quot;uNJ7&quot;&gt;const express = require(&amp;#x27;express&amp;#x27;); const util = require(&amp;#x27;util&amp;#x27;); const exec = util.promisify(require(&amp;#x27;child_process&amp;#x27;).exec); const app = express(); app.get(&amp;#x27;/network_health&amp;#x27;, async (req, res) =&amp;gt; { const { timeout,ㅤ} = req.query; const checkCommands = [ &amp;#x27;ping -c 1 google.com&amp;#x27;, &amp;#x27;curl -s &lt;a href=&quot;http://example.com/&quot; target=&quot;_blank&quot;&gt;http://example.com/&lt;/a&gt;&amp;#x27;,ㅤ ]; try { await Promise.all(checkCommands.map(cmd =&amp;gt; cmd &amp;amp;&amp;amp; exec(cmd, { timeout: +timeout || 5_000 }))); res.status(200); res.send(&amp;#x27;ok&amp;#x27;); } catch(e) { res.status(500); res.send(&amp;#x27;failed&amp;#x27;); } }); app.listen(8080);&lt;/p&gt;

</content></entry></feed>