-
Notifications
You must be signed in to change notification settings - Fork 180
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
feat: egg style && upgrade to 2 #19
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
非常感谢~!可以升级node8; yield -> await 后续我再修改好了 |
egg 2 其实是 break change 的,虽然我们尽可能兼容了,但有一些插件不一定会支持。 这个项目没有测试,所以我也没办法保证全部改对了,可能你们要自己测试下。 另外,几个建议:
|
嗯,再次感谢建议~ pm2主要是我们内网有另外几个node服务,统一用了pm2做管理,后续再补上egg-scripts。 |
wuomzfx
approved these changes
Dec 1, 2017
wuomzfx
approved these changes
Dec 1, 2017
@atian25 如果controller 改为纯class方式声明,要自定义controller基类的话,也应该是先声明一个基类,再在其他具体controller文件中引用此基类再继承它。像这样: // 基类 abstract.js
const Controller = require('egg').Controller
class AbstractController extends Controller {
success (data) {
this.ctx.status = 200
this.ctx.body = data
}
}
module.exports = AbstractController
// 某具体controller ,user.js
const AbstractController = require('./abstract')
class UserController extends AbstractController {
async create () {
// code
}
}
module.exports = UserController 而egg 自定义基类文档中貌似还是按之前启动自定义的方式。 |
这里可以先这样下,这块还在讨论。 |
wangqiang0121
pushed a commit
to wangqiang0121/api-mocker
that referenced
this pull request
Mar 14, 2019
wangqiang0121
pushed a commit
to wangqiang0121/api-mocker
that referenced
this pull request
Mar 14, 2019
feat: 添加优化相关修改 Closes DXY-F2E#39, DXY-F2E#21, DXY-F2E#38, DXY-F2E#25, DXY-F2E#19, and DXY-F2E#33 See merge request f2e/api-mocker!12
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
egg 升级为 2.0
^
引入,close 对依赖引入的建议 #18插件升级
升级 egg 2.0 基本上是无痛的,一行代码修改依赖即可。
但由于
egg-mongoose
这个插件很早前 BREAK 过,所以对应的代码要改下: