Browse Source

Fixed isTrue variable initialization in validate.JS

pull/1/head
Muthu Kumar 7 years ago
parent
commit
431ba1d808
  1. 5
      index.js
  2. 2
      util/validate.js

5
index.js

@ -61,7 +61,10 @@ program
console.log(portInvalidMsg[1])
return }
else { */
if (!validate(domain, inPort, outPort)) return
if (!validate(domain, inPort, outPort)) {
console.log("I should get printed if I'm not validated")
return
}
createProxyServer(domain, inPort, outPort)
console.log("Done! Your server has been set up!\nPoint your domain to this server and check " + chalk.cyan(domain) + " to verify!")
//}

2
util/validate.js

@ -8,7 +8,7 @@ function validate(domain, inPort, outPort = undefined) {
var portInvalidMsg = ["\nPort should be a number.", "\nPort should be a number from 1 and 65535."]
var validInPort = /^\d+$/.test(inPort)
var validOutPort = /^\d+$/.test(outPort)
var isTrue
var isTrue = true
if (!isDomain(domain)) {
console.log(domainInvalidMsg)
return isTrue = false

Loading…
Cancel
Save