diff --git a/backend/app.ts b/backend/app.ts index 9f31a09..3bdac92 100644 --- a/backend/app.ts +++ b/backend/app.ts @@ -7,6 +7,7 @@ import { log } from './log'; import { ensureFiles } from './data'; import { UserConfig } from './UserConfig'; import { ServerConfiguration } from 'ass'; +import { MySql } from './sql/mysql'; /** * Custom middleware to attach the ass object (and construct the `host` property) @@ -63,6 +64,9 @@ async function main() { await new Promise((resolve) => UserConfig.readConfigFile().then(() => resolve(void 0)) .catch((err) => (err.code && err.code === 'ENOENT' ? {} : console.error(err), resolve(void 0)))); + // If user config is ready, try to configure SQL + if (UserConfig.ready) await MySql.configure(); + // Set up Express const app = express();