Add api endpoint for stats #6
1 changed files with 2 additions and 5 deletions
7
EUS.js
7
EUS.js
|
@ -60,13 +60,10 @@ fs.access(`${__dirname}${BASE_PATH}/config.json`, error => {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
} else {
|
} 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 = {
|
module.exports = {
|
||||||
extras:function() {
|
extras:function() {
|
||||||
// Setup express to use busboy
|
// Setup express to use busboy
|
||||||
|
@ -158,7 +155,7 @@ module.exports = {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
global.modules.consoleHelper.printInfo(emoji.heavy_check, `${req.method}: Upload of ${fileOutName} finished. Took ${endTime - startTime}ms`);
|
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
|
// Send URL of the uploaded image to the client
|
||||||
res.end(exportURL+""+fileOutName);
|
res.end(eusConfig.baseURL+""+fileOutName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue