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

refactor: use async function and support koa@2 #4

Merged
merged 4 commits into from
Nov 8, 2017
Merged

refactor: use async function and support koa@2 #4

merged 4 commits into from
Nov 8, 2017

Conversation

dead-horse
Copy link
Member

No description provided.

@dead-horse dead-horse mentioned this pull request Nov 8, 2017
29 tasks
@dead-horse
Copy link
Member Author

@fengmk2 合并发个大版本吧

@fengmk2
Copy link
Member

fengmk2 commented Nov 8, 2017

image

@dead-horse node >= 8.0.0 吧,都改掉

@@ -32,7 +32,7 @@ $ npm install koa-override --save
## Usage

```js
const bodyParser = require('koa-body-parser')
const bodyParser = require('koa-bodyparser')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.... 这个库名不会坑死人么

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

无所谓了,koa-bodyparser 是我们维护的,body-parser 估计是最早占了坑了

@codecov-io
Copy link

codecov-io commented Nov 8, 2017

Codecov Report

Merging #4 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #4   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          19     19           
=====================================
  Hits           19     19
Impacted Files Coverage Δ
index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d58fe55...36f5396. Read the comment docs.

@dead-horse
Copy link
Member Author

done

return function* overrideMethod(next) {
const orginalMethod = this.request.method;
if (options.allowedMethods.indexOf(orginalMethod) === -1) return yield next;
return function overrideMethod(ctx, next) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrow function ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrow function 就丢函数名了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

package.json Outdated
@@ -7,7 +7,7 @@
"index.js"
],
"scripts": {
"test": "mocha -r co-mocha -R spec -t 5000 test/*.test.js",
"test": "mocha -R spec -t 5000 test/*.test.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 egg-bin 不?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 egg-bin 吧,方便以后统一升级。

@fengmk2 fengmk2 merged commit e92571f into master Nov 8, 2017
@fengmk2 fengmk2 deleted the async branch November 8, 2017 09:05
@fengmk2
Copy link
Member

fengmk2 commented Nov 8, 2017

3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants