Skip to content

Commit ba5b0c5

Browse files
committed
fix(example): update middleware usage example
1 parent 9a72543 commit ba5b0c5

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*.spec.js
22
node_modules
33
.idea
4-
tmp

koaexample.js renamed to koa-example.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ app.use(async (ctx, next) => {
1212
await next();
1313
});
1414
app.use(logFactory.getMiddleware());
15-
app.use(async () => {
15+
app.use(async (ctx) => {
1616
logger.info('works');
17+
ctx.body = 'It works';
1718
});
1819

1920
app.listen(port);

package-lock.json

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"test": "mocha ./src/ --recursive",
88
"test:watch": "mocha ./src/ --recursive --watch",
9-
"semantic-release": "CI=true semantic-release pre && npm publish --access public && semantic-release post"
9+
"semantic-release": "CI=true semantic-release pre && npm publish --access public && semantic-release post",
10+
"koa-example": "DEBUG=* node koa-example.js"
1011
},
1112
"bin": {
1213
"json-logger": "./bin/json-logger.js"

tmp/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)