Add api endpoint for status

This commit is contained in:
tgpethan 2020-02-20 07:41:04 +00:00
parent 407f9ddf89
commit 9e23c68204
1 changed files with 2 additions and 5 deletions

7
EUS.js
View File

@ -60,13 +60,10 @@ fs.access(`${__dirname}${BASE_PATH}/config.json`, error => {
process.exit(0);
});
} else {
eusConfig = require(`${__dirname}${BASE_PATH}/image-type.json`);
eusConfig = require(`${__dirname}${BASE_PATH}/config.json`);
}
});
// Construct the full exported url from the config string and port using javascript magic
const exportURL = `${eusConfig.baseURL}:${config.server.port}/`;
module.exports = {
extras:function() {
// Setup express to use busboy
@ -158,7 +155,7 @@ module.exports = {
if (err) throw err;
global.modules.consoleHelper.printInfo(emoji.heavy_check, `${req.method}: Upload of ${fileOutName} finished. Took ${endTime - startTime}ms`);
// Send URL of the uploaded image to the client
res.end(exportURL+""+fileOutName);
res.end(eusConfig.baseURL+""+fileOutName);
});
});
});