Skip to content
Snippets Groups Projects
Commit 67b27aec authored by michael.minelli's avatar michael.minelli
Browse files

Routes => Add a route that provide to client the configuration

parent 3b622774
No related branches found
No related tags found
No related merge requests found
......@@ -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
});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment