diff --git a/package-lock.json b/package-lock.json index 6f14058..99d31f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "@tsconfig/node14": "^1.0.1", "@types/bcrypt": "^5.0.0", "@types/cors": "^2.8.12", + "@types/dotenv-flow": "^3.1.1", "@types/express": "^4.17.13", "@types/express-session": "^1.17.4", "@types/qrcode": "^1.4.1", @@ -264,6 +265,12 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", "dev": true }, + "node_modules/@types/dotenv-flow": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/dotenv-flow/-/dotenv-flow-3.1.1.tgz", + "integrity": "sha512-khxgP+KkHPL72SP0Wqn1gB6EHj6yk79OBGJEKW64XL13RbyDGTkRbbA47VICOLRrvgKOpZeun2uMsgO7pAsExQ==", + "dev": true + }, "node_modules/@types/express": { "version": "4.17.13", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", @@ -4755,6 +4762,12 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", "dev": true }, + "@types/dotenv-flow": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/dotenv-flow/-/dotenv-flow-3.1.1.tgz", + "integrity": "sha512-khxgP+KkHPL72SP0Wqn1gB6EHj6yk79OBGJEKW64XL13RbyDGTkRbbA47VICOLRrvgKOpZeun2uMsgO7pAsExQ==", + "dev": true + }, "@types/express": { "version": "4.17.13", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", diff --git a/package.json b/package.json index 75e5089..591a81a 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@tsconfig/node14": "^1.0.1", "@types/bcrypt": "^5.0.0", "@types/cors": "^2.8.12", + "@types/dotenv-flow": "^3.1.1", "@types/express": "^4.17.13", "@types/express-session": "^1.17.4", "@types/qrcode": "^1.4.1", diff --git a/src/app.ts b/src/app.ts index 54370c6..4c0cb26 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,12 +1,14 @@ -import express = require("express"); -import session = require("express-session"); -import cors = require("cors"); +import * as dotenvFlow from "dotenv-flow"; +dotenvFlow.config(); + +import express from "express"; +import session from "express-session"; +import cors from "cors"; import { corsOpts, sessionOpts } from "./session"; import { TelegramWebhookRoute } from "./routes/TelegramWebhookRoute"; import { LoginRoute } from "./routes/LoginRoute"; import { CodeRoute } from "./routes/CodeRoute"; import { VerifyRoute } from "./routes/VerifyRoute"; -require("dotenv-flow").config(); console.log(`Node Environment: ${process.env.NODE_ENV}`);