From 7dc01210318936d44d0742b99dcc968b0b1fb200 Mon Sep 17 00:00:00 2001 From: jj Date: Sun, 27 Oct 2024 18:12:59 +0000 Subject: [PATCH] api: defer file loads until api is running --- api/src/core/api.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/api/src/core/api.js b/api/src/core/api.js index 4811cd40..9532be81 100644 --- a/api/src/core/api.js +++ b/api/src/core/api.js @@ -345,14 +345,6 @@ export const runAPI = (express, app, __dirname) => { setGlobalDispatcher(new ProxyAgent(env.externalProxy)) } - if (env.apiKeyURL) { - APIKeys.setup(env.apiKeyURL); - } - - if (env.cookiePath) { - Cookies.setup(env.cookiePath); - } - app.listen(env.apiPort, env.listenAddress, () => { console.log(`\n` + Bright(Cyan("cobalt ")) + Bright("API ^ω⁠^") + "\n" + @@ -367,6 +359,14 @@ export const runAPI = (express, app, __dirname) => { Bright("url: ") + Bright(Cyan(env.apiURL)) + "\n" + Bright("port: ") + env.apiPort + "\n" - ) + ); + + if (env.apiKeyURL) { + APIKeys.setup(env.apiKeyURL); + } + + if (env.cookiePath) { + Cookies.setup(env.cookiePath); + } }) }