chore: Adds backend ID returning.
This commit is contained in:
parent
569016711a
commit
3d5d7d4446
4 changed files with 14 additions and 3 deletions
|
@ -3,6 +3,10 @@ export type ParameterReturnedValue = {
|
|||
message?: string
|
||||
}
|
||||
|
||||
export type ConnectedClients = {
|
||||
|
||||
};
|
||||
|
||||
export interface BackendInterface {
|
||||
new(): {
|
||||
addConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): void;
|
||||
|
@ -14,6 +18,9 @@ export interface BackendInterface {
|
|||
destPort: number,
|
||||
protocol: "tcp" | "udp"
|
||||
}[];
|
||||
|
||||
status: "running" | "stopped" | "starting";
|
||||
logs: string[],
|
||||
},
|
||||
|
||||
checkParametersConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): ParameterReturnedValue;
|
||||
|
|
|
@ -47,7 +47,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
});
|
||||
};
|
||||
|
||||
await prisma.desinationProvider.create({
|
||||
const backend = await prisma.desinationProvider.create({
|
||||
data: {
|
||||
name: body.name,
|
||||
description: body.description,
|
||||
|
@ -58,7 +58,8 @@ export function route(routeOptions: RouteOptions) {
|
|||
});
|
||||
|
||||
return {
|
||||
success: true
|
||||
success: true,
|
||||
id: backend.id
|
||||
};
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue