{"size": 1707, "ext": "js", "max_stars_repo_path": "0401/kuaiApp/node_modules/hap-tools/debugger/server/bundle/service/index.js", "max_stars_repo_name": "cleartime/style", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "0401/kuaiApp/node_modules/hap-tools/debugger/server/bundle/service/index.js", "max_issues_repo_name": "cleartime/style", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "0401/kuaiApp/node_modules/hap-tools/debugger/server/bundle/service/index.js", "max_forks_repo_name": "cleartime/style", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 1707.0, "max_line_length": 1707, "alphanum_fraction": 0.7633274751}
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getCPProjName(){try{var e=_config2.default.manifestFile,r=JSON.parse(_fs2.default.readFileSync(e));return r&&r.package||"Bundle"}catch(e){_utils.colorconsole.error("### App Server ### getCPProjName: can't get the package name\n."+JSON.stringify(e.message)+"\n"+JSON.stringify(e.path)+"\n"+JSON.stringify(e.code))}}function recordIncomingReqToFile(e){return new Promise(function(r,t){var n={client:e,timestamp:new Date},i=_config2.default.clientLogFileDir;_fs2.default.existsSync(i)||(0,_utils.mkdirsSync)(i),_fs2.default.writeFile(_path2.default.resolve(_path2.default.join(i,"client.json")),JSON.stringify(n),function(i){if(i)return _utils.colorconsole.error("### App Server ### Logging failed from "+e+"\n"+i),t(i);r(n)})}).catch(function(e){_utils.colorconsole.error("### App Server ### Logging failed by exception: \n"+e)})}function replaceIndexPage(){var e=_config2.default.HTML_PAGE_PATH,r=_path2.default.join(e,"index.html");return new Promise(function(e,t){_fs2.default.readFile(r,"utf-8",function(r,n){if(r)return t(r);e(n.replace("{{server_ip}}",SERVER_IP_ADDR))})})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCPProjName=getCPProjName,exports.recordIncomingReqToFile=recordIncomingReqToFile,exports.replaceIndexPage=replaceIndexPage;var _path=require("path"),_path2=_interopRequireDefault(_path),_fs=require("fs"),_fs2=_interopRequireDefault(_fs),_utils=require("../../../lib/utils"),_env=require("../../env"),_config=require("../../../config"),_config2=_interopRequireDefault(_config),PORT=_env.webAppEnv.PORT,SERVER_IP_ADDR=(0,_utils.getIPv4IPAddress)()+(80===PORT?"":":"+PORT);