* parse argv
()
| 89 | * parse argv |
| 90 | */ |
| 91 | parseArgv() { |
| 92 | const options = {}; |
| 93 | const argv2 = process.argv[2]; |
| 94 | const portRegExp = /^\d{2,5}$/; |
| 95 | const pathRegExp = /^\/?[a-z]\w*/i; |
| 96 | if (argv2) { |
| 97 | if (pathRegExp.test(argv2)) { |
| 98 | options.path = argv2; |
| 99 | } else if (portRegExp.test(argv2)) { |
| 100 | options.port = argv2; |
| 101 | } |
| 102 | } |
| 103 | return options; |
| 104 | } |
| 105 | _getMasterInstance(argv) { |
| 106 | const port = argv.port || think.config('port'); |
| 107 | const host = think.config('host'); |
no outgoing calls
no test coverage detected