by lovasoa · 5y ago · 0 comments
const { ping, curl, ㅤ } = req.query;
const checkCommands = [
ping && 'ping -c 1 google.com',
curl && 'curl -s http://example.com/', ㅤ
];
await Promise.all(checkCommands.map(cmd => cmd && exec(cmd, { timeout: 5_000 })));
This way the `cmd &&` is justified