Skip to content

Jetty Server

<dependency>
<groupId>com.google.genkit</groupId>
<artifactId>genkit-plugin-jetty</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
import com.google.genkit.plugins.jetty.JettyPlugin;
import com.google.genkit.plugins.jetty.JettyPluginOptions;
JettyPlugin jetty = new JettyPlugin(JettyPluginOptions.builder()
.port(8080)
.build());
Genkit genkit = Genkit.builder()
.plugin(jetty)
.build();
// Define your flows here...
// Start the server (blocks until stopped)
jetty.start();

All defined flows are automatically exposed as HTTP endpoints.

Terminal window
curl -X POST http://localhost:8080/api/flows/tellJoke \
-H "Content-Type: application/json" \
-d '{"data": "pirates"}'