Files
lst_v3/backend/mobile/version.route.ts
Blake Matthes cd13360cfb
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
feat(intial auth): intial auth setup for the scanner
2026-05-05 19:48:36 -05:00

29 lines
725 B
TypeScript

import fs from "node:fs";
import { Router } from "express";
import path from "path";
const router = Router();
const projectRoot = path.resolve("./lstMobile"); // adjust as needed
const appJsonPath = path.join(projectRoot, "app.json");
router.get("/", async (req, res) => {
const baseUrl = `${req.protocol}://${req.get("host")}`;
const raw = fs.readFileSync(appJsonPath, "utf-8");
const config = JSON.parse(raw);
const exp = config.expo;
res.json({
packageName: exp.android?.package,
versionName: exp.version,
versionCode: exp.android?.versionCode,
minSupportedVersionCode: exp?.android?.minSupportedVersionCode ?? 0,
downloadUrl: `${baseUrl}/lst/api/mobile/apk/latest`,
});
});
export default router;