status api

This commit is contained in:
Simon Larsen 2022-05-24 18:05:47 +01:00
parent 9d426f8c5c
commit 7eca08dcff
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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;
};