Name: egg-subapp
Owner: egg
Description: an egg plugin for create multi-site applications quickly and easily
Created: 2018-01-02 16:02:48.0
Updated: 2018-02-24 06:39:42.0
Pushed: 2018-02-04 13:45:00.0
Homepage: null
Size: 22
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
help you create multi-site applications quickly and easily
i egg-subapp --save
onfig/plugin.js
rts.subapp = {
able: true,
ckage: 'egg-subapp',
????????
demo.subapp.com
|- controller
|- middleware
|- service
|- router
|- index.js
|- book.js
|- ...
demo2.subapp.com
|- ...
????????????????????controller?middleware?service??????????
controller?middleware????egg?????
????????controller??service??????
s HomeController extends Controller {
ync findUser() {
const { ctx } = this;
// ??ctx.subAppService???service????
ctx.body = await ctx.subAppService.user.findUser();
onfig/config.default.js
rts.subApp = {
rtualHosts: {
// ???????
'custom-domain.com': 'demo.subapp.com',
ddleware: {
// ??????????????
// 'demo.subapp.com': [ needLogin, ... ],
?? config/config.default.js ??????????