From f830bab4ec14f3fe814962a6a2dee180149c3a6a Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Mon, 20 Sep 2021 19:43:18 +0000 Subject: The Whole Barnshow Commit - Use yarn-berry instead of npm, with Zero Install feature and goodies - Add `initializeToken` to post unique token to logs on startup - Package upgrades - Fix index.html.template tests I will never do this again --- src/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index a488538..5f688f8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,12 @@ dotenv.config(); import routes from "./routes"; import Metadata, { EnvConfig } from "./metadata"; import loggerConfig from "./util/logger"; -import { configOrError, handleStartup, handleShutdown } from "./util/config"; +import { + configOrError, + handleStartup, + handleShutdown, + initializeToken +} from "./util/config"; // Start-up configuration const BIND_ADDRESS = process.env.BIND_ADDRESS ?? "localhost"; @@ -18,7 +23,7 @@ const PORT = Number(process.env.PORT ?? 3000); const MONGO_URI = configOrError("MONGO_URI"); const TARGET_URL = process.env.TARGET_URL ?? "http://localhost:3000"; const ENV_CONFIG: EnvConfig = { - token: process.env.TOKEN ?? "", + token: process.env.TOKEN ?? initializeToken(), uploadLimit: Number(process.env.UPLOAD_LIMIT ?? 4194304), publicDir: path.join(__dirname, "..", "public"), hostDir: configOrError("HOST_DIR"), -- cgit