mirror of
https://github.com/HirziDevs/PteroStats
synced 2026-01-07 22:15:33 +00:00
Remove Validate Function
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user