mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-18 03:01:09 +01:00
🚑️ Ping array (#823)
This commit is contained in:
@@ -35,6 +35,13 @@ function Put(req: NextApiRequest, res: NextApiResponse) {
|
||||
apps: [
|
||||
...config.apps.map((app) => ({
|
||||
...app,
|
||||
network: {
|
||||
...app.network,
|
||||
statusCodes: app.network.okStatus === undefined ?
|
||||
app.network.statusCodes :
|
||||
app.network.okStatus.map((x) => x.toString()),
|
||||
okStatus: undefined,
|
||||
},
|
||||
integration: {
|
||||
...app.integration,
|
||||
properties: app.integration.properties.map((property) => {
|
||||
|
||||
@@ -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