Update hosts form
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user