mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-07-21 05:31:25 +02:00
18 lines
339 B
Go
18 lines
339 B
Go
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
|
|
}
|