mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-08-09 13:24:52 +02:00
Incorporated gin server.
Each node communicates in the mesh
This commit is contained in:
17
pkg/ctrlserver/api/api.go
Normal file
17
pkg/ctrlserver/api/api.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user