feat(intial auth): intial auth setup for the scanner
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
This commit is contained in:
28
backend/mobile/version.route.ts
Normal file
28
backend/mobile/version.route.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user