-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
docs(middleware.md): translated & proofread 'middleware.md' #783
Conversation
'middleware.md' is translated by @lslxdx and proofread by @闷油瓶小张
Codecov Report
@@ Coverage Diff @@
## master #783 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 25 25
Lines 641 641
=====================================
Hits 641 641 Continue to review full report at Codecov.
|
docs/source/en/basics/middleware.md
Outdated
function* gzip(next) { | ||
yield next; | ||
|
||
// convert the reaponse body to gzip after the completion of the execution of subsequent middleware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: reaponse
-> response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 👍
docs/source/en/basics/middleware.md
Outdated
if (!body) return; | ||
if (isJSON(body)) body = JSON.stringify(body); | ||
|
||
// set gzip body, correct the reponse header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reponse
-> response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 👍
docs/source/en/basics/middleware.md
Outdated
|
||
Usually the middleware has its own configuration. In the framework, a complete middleware is including the configuration process. We agree that a middleware is a separate file placed in `app/middleware` directory, which needs a exports function that take two paramters: | ||
|
||
- options: the configuration field of the middleware, `app.config[${middlewareName}]` will be passed in by the frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the framework
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 You're right, it's my fault.
Next time I will paste the doc to LibreOffice (any recommendation?) to find typos before commit it.
docs/source/en/basics/middleware.md
Outdated
return function* gzip(next) { | ||
yield next; | ||
|
||
// convert the reaponse body to gzip after the completion of the execution of subsequent middleware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reaponse
docs/source/en/basics/middleware.md
Outdated
|
||
if (isJSON(body)) body = JSON.stringify(body); | ||
|
||
// set gzip body, correct the reponse header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reponse
docs/source/en/basics/middleware.md
Outdated
|
||
## Default Framework Middleware | ||
|
||
In addition to the application layer middleware is imported, the framework itself and other plug-ins will also import many middleware. All the config fields of these built-in middlewares can be modified by modifying the ones with the same name in the config file, for example [Framework Built-in Plugin](https://github.com/eggjs/egg/tree/master/app/middleware) uses a bodyParser middleware(the framework loader will change the file name separated by delimiters into the camel style), and we can add configs below in `config/confg.default.js` to modify the bodyParser: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: config/confg.default.js
-> config/config.default.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 👍
fix typos like: 'reaponse -> response', 'config/confg.default.js -> config/config.default.js' and so on. Thanks to @atian25
Fixed and the revision is 1bdef05. |
What should I do next to make this PR be merged? |
@lslxdx just wait for other guys review |
Please use github email as commit author email |
@fengmk2 Oops, I forgot it! Should I re-commit the doc and create a new PR? |
Checklist
Affected core subsystem(s)
Description of change
'middleware.md' is translated by @lslxdx and proofread by @闷油瓶小张
mv to #784