25 lines
436 B
Go
25 lines
436 B
Go
package generalnode
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
func Start() {
|
|
router := gin.Default()
|
|
|
|
// Get Status
|
|
router.GET("/status", func(c *gin.Context) {
|
|
c.JSON(200, gin.H{
|
|
"message": "pong",
|
|
})
|
|
})
|
|
|
|
// Add Service
|
|
router.POST("/service", func(c *gin.Context) {
|
|
c.JSON(200, gin.H{
|
|
"serviceName": "service1",
|
|
"status": "registered",
|
|
})
|
|
})
|
|
|
|
router.Run("localhost:8000") // listen and serve on 0.0.0.0:8000
|
|
}
|