improve /version api route to only call git once on startup
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
import express, { Request, Response } from 'express';
|
||||
|
||||
function get(req: Request, res: Response) {
|
||||
const revision = require('child_process')
|
||||
.execSync('git rev-parse --short HEAD')
|
||||
.toString().trim()
|
||||
const revision = req.app.locals.versionRev;
|
||||
res.status(200).send({ version: '1.0.0', commit: revision });
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user