Add public Android APK download
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
const fs = require('fs/promises');
|
||||
const path = require('path');
|
||||
const env = require('../../config/env');
|
||||
|
||||
const getAndroidApk = async () => {
|
||||
const filePath = env.androidApkPath;
|
||||
|
||||
try {
|
||||
await fs.access(filePath);
|
||||
} catch {
|
||||
const error = new Error('Android APK not found.');
|
||||
error.statusCode = 404;
|
||||
throw error;
|
||||
}
|
||||
|
||||
return {
|
||||
filePath,
|
||||
fileName: path.basename(filePath),
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getAndroidApk,
|
||||
};
|
||||
Reference in New Issue
Block a user