Skip to content

Commit 2025609

Browse files
author
khanh2906
committed
update v0.6.18
1 parent b277c62 commit 2025609

File tree

16 files changed

+32
-32
lines changed

16 files changed

+32
-32
lines changed

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| Version | Supported |
66
| ------- | ------------------ |
77
| 0.5.3 | :white_check_mark: |
8-
| 0.6.16 | :white_check_mark: |
8+
| 0.6.18 | :white_check_mark: |
99

1010

1111
## Reporting a Vulnerability

lib/handlers/generateElements.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function generateController(targetPath, name, funcList, type) {
2828
module.exports = {
2929
index: async function (req, res, next) {
3030
try {
31-
await res.send("Hello World");
31+
return res.send("Hello World");
3232
next();
3333
} catch (error) {
3434
next(error)
@@ -44,7 +44,7 @@ module.exports = {
4444
${func}: async function (req, res, next) {
4545
try {
4646
// ${func} implementation
47-
await res.send("Hello World");
47+
return res.send("Hello World");
4848
} catch (error) {
4949
next(error)
5050
}

lib/stubs/elements/controller.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module.exports = {
44
index: async function (req, res, next) {
55
try {
6-
await res.send("Hello World")
6+
return res.send("Hello World")
77
} catch(error) {
88
next(error)
99
}

lib/stubs/template/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "bamimi",
3-
"version": "0.6.16",
3+
"version": "0.6.18",
44
"description": "Power framework for nodejs",
55
"main": "src/server.js",
6-
"bamimiVersion": "0.6.16",
6+
"bamimiVersion": "0.6.18",
77
"bin": {
88
"bamimi-enjoy-": "./dist/routes/cli/index.js",
99
"bamimi-enjoy-dev": "./src/routes/cli/index.js"

lib/stubs/template/src/app/http/controllers/api/demo.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
name: "demo user",
99
age: 12
1010
}
11-
res.status(200).sendUser(user);
11+
return res.status(200).sendUser(user);
1212
} catch (error) {
1313
next(error)
1414
}

lib/stubs/template/src/app/http/controllers/web/demo.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { bamimiVersion } = require("./../../../../../package.json")
55
module.exports = {
66
index: async function (req, res, next) {
77
try {
8-
res.view({
8+
return res.view({
99
view: "pages/home", data: {
1010
version: `v${bamimiVersion}`
1111
}

lib/stubs/template/src/app/http/requests/.gitkeep

Whitespace-only changes.

lib/stubs/template/src/kernel/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ exports.middleware = {
6565
req.reqType = 'api'
6666
next();
6767
},
68-
require("@iApp/http/responses/api.res"),
68+
require("@iKernel/response/api"),
6969
cors(authConfig.cors)
7070
],
7171
web: [
@@ -92,7 +92,7 @@ exports.middleware = {
9292
}),
9393

9494
csrf.setTokenLocalsParam,
95-
require("@iApp/http/responses/web.res"),
95+
require("@iKernel/response/web"),
9696
methodOverride('X-HTTP-Method'),
9797
methodOverride('X-HTTP-Method-Override'),
9898
methodOverride('X-Method-Override'),
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"use strict";
2+
const ValidationWebResponse = require("./validationWeb");
3+
const ValidationApiResponse = require("./validationApi");
4+
5+
module.exports = {
6+
validateWeb: validations => {
7+
validations.push(ValidationWebResponse);
8+
return validations;
9+
},
10+
validateApi: validations => {
11+
validations.push(ValidationApiResponse);
12+
return validations;
13+
}
14+
};

lib/stubs/template/src/app/http/requests/validationApi.req.js renamed to lib/stubs/template/src/kernel/request/validationApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = async (req, res, next) => {
1717
const errors = validationResult(req);
1818
if (!errors.isEmpty()) {
1919
res.status(400);
20-
return await res.sendData(errors.array());
20+
res.sendData(errors.array());
2121
}
2222

2323
next();

0 commit comments

Comments
 (0)