Posts

Backend REST API or MCP JSON RPC

package n import (     "errors"     "log"     "net/http" ) var page string func Welcome () {     log . Println ( "Hello, Go!" )     //http.Handle("/welcome", http.HandlerFunc(welcome))     http . HandleFunc ( "/welcome" , welcome )     e := http . ListenAndServe ( ":8999" , nil )     if e != nil && ! errors . Is ( e , http . ErrServerClosed ) {         log . Fatal ( e )     } } func welcome ( rw http . ResponseWriter , req * http . Request ) {     rw . Write ([] byte ( "Welcome to Norman!" ))     //fmt.Fprint(rw, page) }   package main import (     "encoding/json"     "log"     "net/http" ) func main () {     http . HandleFunc ( "/health" , func ( w http . ResponseWriter , r * http . Request ) {         w . Header (). Set ( "Content-Type" , "application/json" )  ...