refactor: general-node and map-node to use flotte types for service registration

This commit is contained in:
2025-02-11 15:17:34 +01:00
parent eec969fc75
commit 88caecde51
8 changed files with 146 additions and 28 deletions

View File

@@ -3,11 +3,17 @@ package reducenode
import "github.com/gin-gonic/gin"
func Start() {
err := registerAsReduceNode()
if err != nil {
panic(err)
}
router := gin.Default()
router.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
router.Run() // listen and serve on 0.0.0.0:8080
router = registerRoutes(router)
router.Run("localhost:4001") // listen and serve on 0.0.0.0:4001
}
func registerAsReduceNode() error {
return nil
}

View File

@@ -0,0 +1,14 @@
package reducenode
import "github.com/gin-gonic/gin"
func registerRoutes(router *gin.Engine) *gin.Engine {
router.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
return router
}