diff --git a/ExpressAPI/src/routes/BaseRoutes.ts b/ExpressAPI/src/routes/BaseRoutes.ts index e26e11ace9bba1b6740f3d7a9af7948a59409d76..f4a74dee7a164f219e3b271614ad6afdb640d6a3 100644 --- a/ExpressAPI/src/routes/BaseRoutes.ts +++ b/ExpressAPI/src/routes/BaseRoutes.ts @@ -2,12 +2,15 @@ import { Express } from 'express-serve-static-core'; import express, { RequestHandler } from 'express'; import { StatusCodes } from 'http-status-codes'; import RoutesManager from '../express/RoutesManager.js'; +import Config from '../config/Config'; class BaseRoutes implements RoutesManager { registerOnBackend(backend: Express) { backend.get('/', this.homepage.bind(this) as RequestHandler); backend.get('/health_check', this.healthCheck.bind(this) as RequestHandler); + + backend.get('/clients_config', this.clientsConfig.bind(this) as RequestHandler); } private async homepage(req: express.Request, res: express.Response) { @@ -17,6 +20,15 @@ class BaseRoutes implements RoutesManager { private async healthCheck(req: express.Request, res: express.Response) { return req.session.sendResponse(res, StatusCodes.OK); } + + private async clientsConfig(req: express.Request, res: express.Response) { + return req.session.sendResponse(res, StatusCodes.OK, { + gitlabUrl : Config.gitlab.url, + gitlabAccountId : Config.gitlab.account.id, + gitlabAccountUsername: Config.gitlab.account.username, + loginGitlabClientId : Config.login.gitlab.client.id + }); + } }