Skip to content

Commit 1fa60b2

Browse files
committed
update controller.js
1 parent bd22272 commit 1fa60b2

File tree

7 files changed

+7
-14
lines changed

7 files changed

+7
-14
lines changed

samples/node/web/koa/url2-koa/controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function addMapping(router, mapping) {
3030
function addControllers(router, dir) {
3131
fs.readdirSync(__dirname + '/' + dir).filter((f) => {
3232
return f.endsWith('.js');
33-
}).every((f) => {
33+
}).forEach((f) => {
3434
console.log(`process controller: ${f}...`);
3535
let mapping = require(__dirname + '/' + dir + '/' + f);
3636
addMapping(router, mapping);
37-
return true;
3837
});
3938
}
4039

samples/node/web/koa/view-koa/controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function addMapping(router, mapping) {
3030
function addControllers(router, dir) {
3131
fs.readdirSync(__dirname + '/' + dir).filter((f) => {
3232
return f.endsWith('.js');
33-
}).every((f) => {
33+
}).forEach((f) => {
3434
console.log(`process controller: ${f}...`);
3535
let mapping = require(__dirname + '/' + dir + '/' + f);
3636
addMapping(router, mapping);
37-
return true;
3837
});
3938
}
4039

samples/node/web/rest/rest-hello/controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function addMapping(router, mapping) {
3030
function addControllers(router, dir) {
3131
fs.readdirSync(__dirname + '/' + dir).filter((f) => {
3232
return f.endsWith('.js');
33-
}).every((f) => {
33+
}).forEach((f) => {
3434
console.log(`process controller: ${f}...`);
3535
let mapping = require(__dirname + '/' + dir + '/' + f);
3636
addMapping(router, mapping);
37-
return true;
3837
});
3938
}
4039

samples/node/web/rest/rest-koa/controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function addMapping(router, mapping) {
3030
function addControllers(router, dir) {
3131
fs.readdirSync(__dirname + '/' + dir).filter((f) => {
3232
return f.endsWith('.js');
33-
}).every((f) => {
33+
}).forEach((f) => {
3434
console.log(`process controller: ${f}...`);
3535
let mapping = require(__dirname + '/' + dir + '/' + f);
3636
addMapping(router, mapping);
37-
return true;
3837
});
3938
}
4039

samples/node/web/vue/mini-excel/controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function addMapping(router, mapping) {
3030
function addControllers(router, dir) {
3131
fs.readdirSync(__dirname + '/' + dir).filter((f) => {
3232
return f.endsWith('.js');
33-
}).every((f) => {
33+
}).forEach((f) => {
3434
console.log(`process controller: ${f}...`);
3535
let mapping = require(__dirname + '/' + dir + '/' + f);
3636
addMapping(router, mapping);
37-
return true;
3837
});
3938
}
4039

samples/node/web/vue/vue-todo-2/controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function addMapping(router, mapping) {
3030
function addControllers(router, dir) {
3131
fs.readdirSync(__dirname + '/' + dir).filter((f) => {
3232
return f.endsWith('.js');
33-
}).every((f) => {
33+
}).forEach((f) => {
3434
console.log(`process controller: ${f}...`);
3535
let mapping = require(__dirname + '/' + dir + '/' + f);
3636
addMapping(router, mapping);
37-
return true;
3837
});
3938
}
4039

samples/node/web/ws/ws-with-koa/controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function addMapping(router, mapping) {
3030
function addControllers(router, dir) {
3131
fs.readdirSync(__dirname + '/' + dir).filter((f) => {
3232
return f.endsWith('.js');
33-
}).every((f) => {
33+
}).forEach((f) => {
3434
console.log(`process controller: ${f}...`);
3535
let mapping = require(__dirname + '/' + dir + '/' + f);
3636
addMapping(router, mapping);
37-
return true;
3837
});
3938
}
4039

0 commit comments

Comments
 (0)