From 72e5c0dedd6657fcf310dd6b598ce175e7b55a2e Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Thu, 14 Nov 2019 16:40:57 +0100 Subject: [PATCH] Improving version support --- src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index e1aa47d..8281be2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,11 +5,13 @@ import { DatabaseManager } from "./database/database"; import { createServer } from "http"; import { ConnectionManager } from "./connection"; import { LoggingTypes } from "@hibas123/logging"; -import * as pk from "../package.json"; +import { readFileSync } from "fs"; Logging.logLevel = config.dev ? LoggingTypes.Debug : LoggingTypes.Log; -Logging.log("Starting Database version:", pk.version); +const version = JSON.parse(readFileSync("./package.json").toString()).version; + +Logging.log("Starting Database version:", version); DatabaseManager.init().then(() => { const http = createServer(Web.callback());