From 7eca08dcfff79c30badee7db338c13e85532dd04 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Tue, 24 May 2022 18:05:47 +0100 Subject: [PATCH] status api --- CommonServer/API/StatusAPI.ts | 4 ++-- CommonServer/Utils/StartServer.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CommonServer/API/StatusAPI.ts b/CommonServer/API/StatusAPI.ts index b92dacc199..c6cfaad019 100644 --- a/CommonServer/API/StatusAPI.ts +++ b/CommonServer/API/StatusAPI.ts @@ -3,12 +3,12 @@ import Express, { ExpressResponse, ExpressRouter, } from '../Utils/Express'; +import LocalCache from '../Infrastructure/LocalCache'; const router: ExpressRouter = Express.getRouter(); - router.get('/', (_req: ExpressRequest, res: ExpressResponse) => { - res.send({ status: 'identity' }); + res.send({ app: LocalCache.getString("app", "name") }); }); // General status diff --git a/CommonServer/Utils/StartServer.ts b/CommonServer/Utils/StartServer.ts index aba412ffde..56a6669849 100644 --- a/CommonServer/Utils/StartServer.ts +++ b/CommonServer/Utils/StartServer.ts @@ -17,6 +17,7 @@ import Express, { import CommonAPI from '../API/Index'; import OneUptimeDate from 'Common/Types/Date'; +import LocalCache from '../Infrastructure/LocalCache'; const app: ExpressApplication = Express.getExpressApp(); @@ -76,5 +77,6 @@ app.use(logRequest); export default (appName: string) => { Express.launchApplication(appName); CommonAPI(appName); + LocalCache.setString("app", "name", appName); return app; };