Remove Validate Function

This commit is contained in:
hirzidevs
2024-08-25 21:35:19 +07:00
parent 66709c43e2
commit b7981dc39a

View File

@@ -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