Initial work on upload app server

This commit is contained in:
Alan Grainger
2026-10-06 10:07:20 +13:00
parent 9e6c00da35
commit 95ac498cf0
38 changed files with 1493 additions and 40 deletions
+15
View File
@@ -0,0 +1,15 @@
import { readFileSync } from 'fs'
/**
* Resolve the running application version. Prefers the APP_VERSION env var
* baked in at Docker build time (see the Dockerfiles); falls back to the
* app's package.json for local dev, and finally to 'dev' if neither is readable.
*/
export function resolveAppVersion (packageJsonPath: string): string {
if (process.env.APP_VERSION) return process.env.APP_VERSION
try {
return JSON.parse(readFileSync(packageJsonPath, 'utf-8')).version || 'dev'
} catch {
return 'dev'
}
}