const axios = require('axios')

const isOnline = (req, res) => {
  axios.get('https://myanimelist.net')
    .then(({status}) => {
      res.status(status === 200 ? 200 : 204).send()
    })
    .catch(() => res.status(204).send())
}

module.exports = isOnline

const axios = require('axios')

const isOnline = async (req, res) => {
  try {
    const {status} = await axios.get('https://myanimelist.net')

    res.status(status === 200 ? 200 : 204).send()
  } catch (e) {
    res.status(204).send()
  }
}

module.exports = isOnline

--- 
+++ 
@@ -1,11 +1,13 @@
 const axios = require('axios')
 
-const isOnline = (req, res) => {
-  axios.get('https://myanimelist.net')
-    .then(({status}) => {
-      res.status(status === 200 ? 200 : 204).send()
-    })
-    .catch(() => res.status(204).send())
+const isOnline = async (req, res) => {
+  try {
+    const {status} = await axios.get('https://myanimelist.net')
+
+    res.status(status === 200 ? 200 : 204).send()
+  } catch (e) {
+    res.status(204).send()
+  }
 }
 
 module.exports = isOnline
Fix attempt to offline leak
