🚑️ Ping array (#823)

This commit is contained in:
Manuel authored and GitHub committed 2023-04-21 10:21:34 +02:00
1 parent f4d936e3e5
commit 5a6c039f5b
6 files changed
+23 -1

No files matched your search

+2
View File
@@ -1,5 +1,6 @@
import axios from 'axios';
import https from 'https';
import Consola from 'consola';
import { NextApiRequest, NextApiResponse } from 'next';
async function Get(req: NextApiRequest, res: NextApiResponse) {
@@ -13,6 +14,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
})
.catch((error) => {
if (error.response) {
Consola.error(`Unexpected response: ${error.response.data}`);
res.status(error.response.status).json(error.response.statusText);
} else if (error.code === 'ECONNABORTED') {
res.status(408).json('Request Timeout');