Incorporated gin server.

Each node communicates in the mesh
This commit is contained in:
Tim Beatham
2023-09-18 15:52:28 +01:00
parent fa16480521
commit 01238aca59
10 changed files with 286 additions and 20 deletions

17
pkg/ctrlserver/api/api.go Normal file
View File

@ -0,0 +1,17 @@
package api
import (
"github.com/gin-gonic/gin"
ctrlserver "github.com/tim-beatham/wgmesh/pkg/ctrlserver"
"github.com/tim-beatham/wgmesh/pkg/ctrlserver/api/mesh"
)
func RunAPI(server *ctrlserver.MeshCtrlServer) *gin.Engine {
r := gin.Default()
r.POST("/mesh", func(ctx *gin.Context) {
mesh.JoinMesh(ctx, server)
})
return r
}