From b7981dc39a426b92575239c7569d823734144567 Mon Sep 17 00:00:00 2001 From: hirzidevs Date: Sun, 25 Aug 2024 21:35:19 +0700 Subject: [PATCH] Remove Validate Function --- handlers/config.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/handlers/config.js b/handlers/config.js index 661329a..b444ac2 100644 --- a/handlers/config.js +++ b/handlers/config.js @@ -9,16 +9,12 @@ if (fs.existsSync("config-dev.yml")) { config = yaml.load(fs.readFileSync("./config-dev.yml", "utf8")); } -validateURL(config.panel.url); - -function validateURL(url) { - try { - const testURL = new URL(url); - if (!testURL.protocol.startsWith("http")) throw new Error(); - } catch { - console.error('Config Error | Invalid URL Format! Example Correct URL: "https://panel.example.com"'); - process.exit(); - } +try { + const testURL = new URL(config.panel.url); + if (!testURL.protocol.startsWith("http")) throw new Error(); +} catch { + console.error('Config Error | Invalid URL Format! Example Correct URL: "https://panel.example.com"'); + process.exit(); } module.exports = config \ No newline at end of file