Update hosts form

This commit is contained in:
2026-09-20 13:48:35 +01:00
parent a9ebd8fb75
commit 3c1d2b61f6
20 changed files with 308 additions and 66 deletions
+3
View File
@@ -43,6 +43,9 @@ export const handler: BunextAPIRouteHandler<APIResponseObject> = async (
wg_ip_address: body?.wg_ip_address,
public_ip_address: body?.public_ip_address,
interface: body?.interface,
name: body?.name,
short_description: body?.short_description,
listen_port: body?.listen_port,
user,
});
} catch (error: any) {
+20
View File
@@ -0,0 +1,20 @@
import getNextAvailableListenPort from "@/src/functions/backend/setup/get-next-available-listen-port";
import type { ApiReqParams } from "@/src/types";
import type {
APIResponseObject,
BunextAPIRouteHandler,
} from "@moduletrace/bunext/types";
export const handler: BunextAPIRouteHandler<APIResponseObject> = async (
params,
) => {
if (params.req.method !== "GET") {
return { success: false };
}
try {
const port = await getNextAvailableListenPort();
return { success: true, numberRes: port };
} catch (error: any) {
return { success: false, msg: error.message };
}
};