🚑️ Ping array (#823)

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

View File

@@ -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) => {

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');