mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-12 08:25:47 +01:00
🚑️ Ping array (#823)
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user