serve.js 439 字节
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3 4
const path = require('path')
const moduleAlias = require('module-alias')
moduleAlias.addAlias('../service', (fromPath, request, alias) => {
  // @hap-toolkit/packager/lib/router/routes/index.js
5
  if (fromPath.indexOf('@hap-toolkit') !== -1 && fromPath.indexOf('packager') !== -1) {
fxy060608's avatar
fxy060608 已提交
6 7 8 9 10
    return path.resolve(__dirname, 'service.js')
  }
  return path.join(fromPath, '..', request)
})
require('@hap-toolkit/server').launchServer({})