智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/21/213ab97c2e8593f160c104752a4...

2 lines
1.5 KiB

"use strict";var _koaRouter=_interopRequireDefault(require("koa-router")),_koaBody=_interopRequireDefault(require("koa-body")),_koaStatic=_interopRequireDefault(require("koa-static")),_config=_interopRequireDefault(require("@hap-toolkit/shared-utils/config")),_conf=require("./lib/conf"),_api=_interopRequireDefault(require("./api")),_routes=_interopRequireDefault(require("./routes")),_service=require("./service"),_wsserver=require("./wsserver"),_adb=require("../adb");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function applyRouter(e){const t=new _koaRouter.default;return t.conf=(0,_conf.init)(__dirname),e.context.router=t,e.use(_routes.default.redirectHtmlReq),e.use((0,_koaStatic.default)(t.conf.staticDir)),t.get(_api.default.index,_routes.default.index),t.post(_api.default.index,(0,_koaBody.default)(),_routes.default.adapterForBackwardComp),t.post(_api.default.register,(0,_koaBody.default)(),_routes.default.register),t.get(_api.default.searchSn,(0,_koaBody.default)(),_routes.default.searchSn),t.post(_api.default.startDebug,(0,_koaBody.default)(),_routes.default.startDebug),t.get(_api.default.qrCode,_routes.default.qrCode),t}async function beforeStart(e,t){await(0,_wsserver.createSocketServer)(e,t);const r=(0,_service.serverConf)(t.context),{disableADB:a}=r.options;a||(t.context.adbDebugger=(0,_adb.createADBDebugger)({pathClientLog:_config.default.clientRecordPath,localReversePort:r.defaults.serverPort}))}module.exports={applyRouter:applyRouter,beforeStart:beforeStart};
//# sourceMappingURL=index.js.map