File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -462,6 +462,32 @@ curl -X POST http://localhost:8080/tellJoke \
462462 -d ' {"data": "programming"}'
463463```
464464
465+ ### Works with Any HTTP Framework
466+
467+ ` genkit.Handler ` returns a standard ` http.HandlerFunc ` , so it works with any Go HTTP framework:
468+
469+ ``` go
470+ // net/http (standard library)
471+ mux := http.NewServeMux ()
472+ mux.HandleFunc (" POST /joke" , genkit.Handler (jokeFlow))
473+ log.Fatal (http.ListenAndServe (" :8080" , mux))
474+
475+ // Gin
476+ r := gin.Default ()
477+ r.POST (" /joke" , gin.WrapF (genkit.Handler (jokeFlow)))
478+ r.Run (" :8080" )
479+
480+ // Echo
481+ e := echo.New ()
482+ e.POST (" /joke" , echo.WrapHandler (genkit.Handler (jokeFlow)))
483+ e.Start (" :8080" )
484+
485+ // Chi
486+ r := chi.NewRouter ()
487+ r.Post (" /joke" , genkit.Handler (jokeFlow))
488+ http.ListenAndServe (" :8080" , r)
489+ ```
490+
465491---
466492
467493## Model Providers
You can’t perform that action at this time.
0 commit comments