We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69810ee commit 62c38a5Copy full SHA for 62c38a5
src/controllers/api.ts
@@ -10,6 +10,7 @@ import logger from "../logger";
10
import { genHashFromFile, setDir } from "../util";
11
import { APP_DIR } from "../vars";
12
13
+const VERSION = process.env.npm_package_version;
14
const TMP_DIR = "tmp";
15
const CONSIGNMENTS_DIR = "consignments";
16
const MEDIA_DIR = "media";
@@ -348,4 +349,15 @@ export const loadApiEndpoints = (app: Application): void => {
348
349
}
350
351
);
352
+
353
+ app.get(
354
+ "/getinfo",
355
+ middleware,
356
+ async (_req: Request, res: Response) => {
357
+ return res.status(200).send({
358
+ version: VERSION,
359
+ uptime: Math.trunc(process.uptime()),
360
+ });
361
+ }
362
+ );
363
};
0 commit comments