serve: rcell: get message header from path

This commit is contained in:
Helmut Merz 2023-08-09 19:46:09 +02:00
parent cbe209643c
commit 7c3c88cfc2

View file

@ -29,9 +29,6 @@ func Serve(ctx lib.Context) {
r := gin.New() r := gin.New()
r.Use(gin.Recovery()) r.Use(gin.Recovery())
r.Use(Logger(ctx)) r.Use(Logger(ctx))
/*r.GET("/*action", func(c *gin.Context) {
c.String(http.StatusOK, "Hello World")
})*/
cfg := ctx.Config().(*Cfg) cfg := ctx.Config().(*Cfg)
for _, rcfg := range cfg.routes { for _, rcfg := range cfg.routes {
setRoute(ctx, rcfg, r) setRoute(ctx, rcfg, r)
@ -62,5 +59,7 @@ func setRoute(ctx lib.Context, rcfg routeCfg, r *gin.Engine) {
// RCell (request / response handler cell) implementation // RCell (request / response handler cell) implementation
func RCell(ctx lib.Context, spec *rcellSpec, gc *gin.Context) { func RCell(ctx lib.Context, spec *rcellSpec, gc *gin.Context) {
fmt.Println("*** RCell called") msg := gc.Param("msg")
fmt.Printf("*** RCell called: msg: %s\n", msg)
gc.String(http.StatusOK, "Hello World")
} }