@@ -54,6 +54,9 @@ import { IamSessionApp } from "./iam/iam-session-app";
54
54
import { LongRunningMigrationService } from "@gitpod/gitpod-db/lib/long-running-migration/long-running-migration" ;
55
55
import { expressConnectMiddleware } from "@bufbuild/connect-express" ;
56
56
import { APIRouter } from "./api/server" ;
57
+ import { UserService as UserServiceDefinition } from "@gitpod/public-api/lib/gitpod/experimental/v1/user_connectweb" ;
58
+ import { APIUserService } from "./api/user" ;
59
+ import { ConnectRouter } from "@bufbuild/connect" ;
57
60
58
61
@injectable ( )
59
62
export class Server < C extends GitpodClient , S extends GitpodServer > {
@@ -95,7 +98,7 @@ export class Server<C extends GitpodClient, S extends GitpodServer> {
95
98
protected iamSessionApp ?: express . Application ;
96
99
protected iamSessionAppServer ?: http . Server ;
97
100
98
- @inject ( APIRouter ) protected readonly apiRouter : APIRouter ;
101
+ @inject ( APIUserService ) protected readonly apiUserService : APIUserService ;
99
102
protected apiServer ?: http . Server ;
100
103
101
104
protected readonly eventEmitter = new EventEmitter ( ) ;
@@ -396,7 +399,13 @@ export class Server<C extends GitpodClient, S extends GitpodServer> {
396
399
397
400
{
398
401
const apiApp = express ( ) ;
399
- apiApp . use ( expressConnectMiddleware ( { routes : this . apiRouter . routes } ) ) ;
402
+ apiApp . use (
403
+ expressConnectMiddleware ( {
404
+ routes : ( router : ConnectRouter ) => {
405
+ router . service ( UserServiceDefinition , this . apiUserService ) ;
406
+ } ,
407
+ } ) ,
408
+ ) ;
400
409
this . apiServer = apiApp . listen ( 9877 , ( ) => {
401
410
log . info ( `Connect API server listening on: ${ < AddressInfo > this . apiServer ! . address ( ) } ` ) ;
402
411
} ) ;
0 commit comments