-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use async function and support egg@2 (#10)
- Loading branch information
1 parent
705ffcb
commit a9cadba
Showing
7 changed files
with
49 additions
and
53 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ module.exports = { | |
'benchmark', | ||
], | ||
devdep: [ | ||
'egg', | ||
'egg-ci', | ||
'egg-bin', | ||
'autod', | ||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
'use strict'; | ||
|
||
exports.index = function*() { | ||
this.body = { foo: 'bar' }; | ||
exports.index = ctx => { | ||
ctx.body = { foo: 'bar' }; | ||
}; | ||
|
||
exports.empty = function*() {}; | ||
|
||
|
||
exports.mark = function*() { | ||
this.body = { jsonpFunction: this.acceptJSONP }; | ||
exports.mark = ctx => { | ||
ctx.body = { jsonpFunction: ctx.acceptJSONP }; | ||
}; | ||
|
||
exports.error = function*() { | ||
exports.error = async () => { | ||
throw new Error('jsonpFunction is error'); | ||
}; | ||
}; |
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