diff --git a/src/app.ts b/src/app.ts index 39a7d2fd..69c49330 100644 --- a/src/app.ts +++ b/src/app.ts @@ -11,6 +11,7 @@ import posthogReporter from "./lib/middleware/posthogMiddleware.js"; import routes from "./routes/index.js"; import path from "path"; +import { getVersion } from "./handler/manager/version.js"; export const app = express(); @@ -44,3 +45,5 @@ app.use("/v1", routes); //theo was here app.get("/status", (req, res) => { res.status(200).send("Server running"); }); + +app.get('/version', getVersion) diff --git a/src/handler/manager/version.ts b/src/handler/manager/version.ts new file mode 100644 index 00000000..2187bf10 --- /dev/null +++ b/src/handler/manager/version.ts @@ -0,0 +1,12 @@ +import { Request, Response } from "express"; + +const VERSION = '26.0.0' + +export const getVersion = async (req: Request, res: Response) => { + + const gitCommit = process.env.RAILWAY_GIT_COMMIT_SHA ?? "no commit id"; + + res.status(200).send({version: VERSION, + gitCommit + }) +} \ No newline at end of file