Skip to content

Commit

Permalink
fix: override alinode default path
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Jan 7, 2019
1 parent 3a191a6 commit f140a18
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Node.js >= 8.0.0 required.
- ✔︎ Scalable plug-in capabilities and group plug-in Ecology
- ✔︎ Good application layering and decoupling capability
- ✔︎ A good development experience for the future
- ✔︎ Support Egg plugins and koa middleware


## Getting Started
Expand All @@ -43,8 +44,8 @@ $ open http://localhost:7001

## Docs & Community

[Website && Documentations](https://midwayjs.org/midway/)
[All Egg Plugins](https://github.com/search?q=topic%3Aegg-plugin&type=Repositories)
- [Website && Documentations](https://midwayjs.org/midway/)
- [All Egg Plugins](https://github.com/search?q=topic%3Aegg-plugin&type=Repositories)

## Examples

Expand Down
4 changes: 2 additions & 2 deletions packages/midway-init/lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ const Command = require('egg-init');
const path = require('path');
const fs = require('fs');
const Parser = require('./parser');
const templateDir = path.join(__dirname, '../boilerplate/');
const os = require('os');

class MidwayInitCommand extends Command {

constructor(options = {}) {
super(Object.assign({}, options));
this.templateDir = path.join(__dirname, '../boilerplate/');
}

* fetchBoilerplateMapping() {
return require('../boilerplate/boilerplate.json');
}

* downloadBoilerplate(pkgName) {
const p = path.join(templateDir, pkgName);
const p = path.join(this.templateDir, pkgName);
if (fs.existsSync(p)) {
return p;
}
Expand Down
12 changes: 12 additions & 0 deletions packages/midway-web/config/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,17 @@ module.exports = (appInfo) => {
]
};

const appRoot = appInfo.env === 'local' || appInfo.env === 'unittest' ? appInfo.appDir : appInfo.HOME;
exports.alinode = {
logdir: path.join(appRoot, 'logs/alinode'),
error_log: [
path.join(appRoot, `logs/${appInfo.pkg.name}/common-error.log`),
path.join(appRoot, 'logs/stderr.log'),
],
packages: [
path.join(appInfo.appDir, 'package.json'),
]
};

return exports;
};
2 changes: 1 addition & 1 deletion packages/midway-web/src/loader/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AppWorkerLoader extends MidwayWebLoader {

this.app.beforeStart(async () => {
await this.refreshContext();
// get controlloer
// get controller
await this.loadController();
// app
this.loadRouter(); // 依赖 controller
Expand Down

0 comments on commit f140a18

Please sign in to comment.