File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
jooby/src/main/java/io/jooby
tests/src/test/java/io/jooby/i3863 Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ import io.jooby.rpc.trpc.TrpcModule;
1919
2020public class App extends Jooby {
2121 {
22- install(new JacksonModule()); // <1>
22+ install(new JacksonModule()); // <1>
2323
24- install(new TrpcModule()); // <2>
24+ install(new TrpcModule()); // <2>
2525
26- install (new MovieService_ ()); // <3>
26+ trpc (new MovieServiceTrpc_ ()); // <3>
2727 }
2828}
2929----
@@ -36,11 +36,11 @@ import io.jooby.json.JacksonModule
3636import io.jooby.rpc.trpc.TrpcModule
3737
3838class App : Kooby({
39- install(JacksonModule()) // <1>
39+ install(JacksonModule()) // <1>
4040
41- install(TrpcModule()) // <2>
41+ install(TrpcModule()) // <2>
4242
43- install(MovieService_ ()) // <3>
43+ trpc(MovieServiceTrpc_ ()) // <3>
4444})
4545----
4646
Original file line number Diff line number Diff line change @@ -535,6 +535,20 @@ public Jooby jsonRpc(@NonNull JsonRpcService service) {
535535 return jsonRpc ("/rpc" , service );
536536 }
537537
538+ /**
539+ * Registers a tRPC router within the application.
540+ *
541+ * <p>This method provides a native DSL entry point for integrating a tRPC router. It provisions
542+ * the tRPC extension by delegating to the underlying {@link #mvc(Extension)} route registration
543+ * mechanism.
544+ *
545+ * @param trpcRouter The tRPC router extension to register. Must not be null.
546+ * @return A {@link Route.Set} containing the registered tRPC endpoints.
547+ */
548+ public Route .Set trpc (@ NonNull Extension trpcRouter ) {
549+ return mvc (trpcRouter );
550+ }
551+
538552 /**
539553 * Add controller routes.
540554 *
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public abstract class AbstractTrpcProtocolTest {
2727 private void setupApp (Jooby app ) {
2828 installJsonEngine (app );
2929 app .install (new TrpcModule ());
30- app .mvc (new MovieServiceTrpc_ ());
30+ app .trpc (new MovieServiceTrpc_ ());
3131 }
3232
3333 @ ServerTest
You can’t perform that action at this time.
0 commit comments