feat: scaffold center and guild backend NestJS skeletons
This commit is contained in:
24
Fabric.Backend.Center/src/nodes/nodes.controller.ts
Normal file
24
Fabric.Backend.Center/src/nodes/nodes.controller.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Body, Controller, Get, Post } from '@nestjs/common';
|
||||
|
||||
type NodeRegistration = {
|
||||
nodeId?: string;
|
||||
name?: string;
|
||||
endpoint?: string;
|
||||
handshakeProof?: string;
|
||||
};
|
||||
|
||||
@Controller('nodes')
|
||||
export class NodesController {
|
||||
private readonly nodes: NodeRegistration[] = [];
|
||||
|
||||
@Post('register')
|
||||
register(@Body() body: NodeRegistration) {
|
||||
this.nodes.push(body);
|
||||
return { status: 'accepted', handshake: 'todo-verify-shared-secret', node: body };
|
||||
}
|
||||
|
||||
@Get()
|
||||
list() {
|
||||
return { items: this.nodes };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user