edited the way api keys are handled.

Since API keys are now loaded from the auth server, this means that there is a delay between starting the software, loading the keys, and loading all the module files.
Due to nodejs running Async, the modules are being loaded BEFORE the api keys have been returned from the auth server.
So now the api keys are being set inside the module every time the module is being called.
This has absolutely no impact on performance, or security, plus, this was the easiest solution, especially as it required no big changes to the rest of the code
This commit is contained in:
2026-01-14 03:01:30 +01:00
parent 5a85a7da4c
commit 6b3724b765
4 changed files with 8 additions and 4 deletions
@@ -1,4 +1,4 @@
const API_KEY = process.env.ASSEMBLYAI_API_KEY;
let API_KEY
const BASE_URL = 'https://api.assemblyai.com/v2';
//---------------------------------------------------Upload audio---------------------------------------------------
@@ -92,6 +92,7 @@ module.exports = {
audioformat: "mp3",
async function(audioFileName) {
API_KEY = process.env.ASSEMBLYAI_API_KEY;
return new Promise(async (resolve, reject) => {
try {
// audioFileName ist nur "datei.mp3"