Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server.routers需要命名空间,而非一概 concat #93

Closed
ImHype opened this issue Apr 2, 2017 · 0 comments
Closed

server.routers需要命名空间,而非一概 concat #93

ImHype opened this issue Apr 2, 2017 · 0 comments
Assignees

Comments

@ImHype
Copy link
Member

ImHype commented Apr 2, 2017

serverPlugin.server 新增接口

//  注册路由的命名空间
registerRouterNamespace(name, value = []) {
    return this.serverOptions.runtimeRouters[name] = value;
}
//  获取运行时的所有路由
getRuntimeRouters() {
    const runtimeRouters = this.serverOptions.runtimeRouters;
    return values(runtimeRouters).reduce((prev, item) => prev.concat(item), []);
}
// 对运行时代的路由进行有副作用的修改
updateRuntimeRouters(fn) {
    return fn(this.getRuntimeRouters())
}
@ImHype ImHype self-assigned this Apr 2, 2017
@ImHype ImHype closed this as completed Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant