From 66e41e9f2a7fef04986be0a904ce7eace28f4742 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Wed, 28 Sep 2022 22:57:11 +0100 Subject: [PATCH] fix(ghbot): general touchups to get it compiling --- github-bot/package.json | 2 +- github-bot/src/config.ts | 7 +++++-- github-bot/src/main.ts | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/github-bot/package.json b/github-bot/package.json index 3d300f80f..28b3cc484 100644 --- a/github-bot/package.json +++ b/github-bot/package.json @@ -6,7 +6,7 @@ "author": "zkldi", "scripts": { "build": "tsc", - "start": "node js/main.js" + "start": "tsc && node js/main.js" }, "dependencies": { "@octokit/webhooks": "10.1.5", diff --git a/github-bot/src/config.ts b/github-bot/src/config.ts index ae693859e..e3e4c8f75 100644 --- a/github-bot/src/config.ts +++ b/github-bot/src/config.ts @@ -1,6 +1,9 @@ -import "dotenv"; +import { config } from "dotenv"; import p from "prudence"; +// init dotenv +config(); + function ParseEnvVars() { const err = p( process.env, @@ -17,7 +20,7 @@ function ParseEnvVars() { ); if (err) { - throw new Error(err.message); + throw new Error(`${err.keychain}: ${err.message}`); } return { diff --git a/github-bot/src/main.ts b/github-bot/src/main.ts index 59165af36..51ed26779 100644 --- a/github-bot/src/main.ts +++ b/github-bot/src/main.ts @@ -142,3 +142,5 @@ app.all("*", (req, res) => ); console.log(`Starting express server on port ${ProcessEnv.port}.`); + +app.listen(ProcessEnv.port);