diff --git a/.npmignore b/.npmignore index d9917bee2..274070bc1 100644 --- a/.npmignore +++ b/.npmignore @@ -3,4 +3,13 @@ config.json docker-compose.yml Dockerfile .vscode -.github \ No newline at end of file +.github +.uibuild +templates +ui +locales +module +hydro +build +tool +.build/install.js diff --git a/hydro/service/server.js b/hydro/service/server.js index f3768a221..0870e7fa4 100644 --- a/hydro/service/server.js +++ b/hydro/service/server.js @@ -306,7 +306,8 @@ function Route(route, RouteHandler, permission = null) { domainId: 'system', ...ctx.params, ...ctx.query, ...ctx.request.body, }; if (h.request.host !== await system.get('server.host')) { - args.domainId = h.request.url.split('//')[1].split(`.${await system.get('server.host')}`)[0] || ''; + args.domainId = (h.request.url.split('//')[1] || '') + .split(`.${await system.get('server.host')}`)[0] || 'system'; } if (h.___prepare) await h.___prepare(args); diff --git a/hydro/service/setup.js b/hydro/service/setup.js index d23dd848c..2ceece936 100644 --- a/hydro/service/setup.js +++ b/hydro/service/setup.js @@ -11,9 +11,70 @@ const mongodb = require('mongodb'); class Loader { getSource(name) { // eslint-disable-line class-methods-use-this - if (!global.Hydro.template[name]) throw new Error(`Cannot get template ${name}`); return { - src: global.Hydro.template[name], + src: ` + + +
+ + + + + + + +