Skip to content

Commit ca3fbe7

Browse files
committed
fix displayRoute not work
1 parent 423c80d commit ca3fbe7

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.nyc_output/8dc9980f21a8070efeda8e2d7f536512.json

+1
Large diffs are not rendered by default.

demo/server.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ let app: express.Application = express();
99

1010
export const routeInfo: Array<IRouteInfo> = new JsonRoute(app, {
1111
"processdir": __dirname,
12+
"displayRoute": true,
1213
"jwt": {
1314
"secret": "12345678910abc"
14-
}
15+
},
1516
}).start();
1617

1718

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "json-routing",
33
"description": "JSON configurable MVC routing for express 4",
4-
"version": "2.0.9",
4+
"version": "2.0.10",
55
"author": "Giorgio Modoni <[email protected]>",
66
"homepage": "http://gimox.github.io/json-routing",
77
"main": "./build/json-route.js",

src/interfaces/IOptions.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ import * as path from "path";
77
* Interface for json-route option
88
*/
99
export interface IOptions {
10-
routesPath?: string
11-
, controllersPath?: string
12-
, policyPath?: string
13-
, processdir?: string
14-
, cors?: boolean
15-
, corsOptions?: any
16-
, displayRoute?: boolean
17-
, defaultAction?: string
18-
, urlPrefix?: string
19-
, jwt?: {
10+
routesPath?: string,
11+
controllersPath?: string,
12+
policyPath?: string,
13+
processdir?: string,
14+
cors?: boolean,
15+
corsOptions?: any,
16+
displayRoute?: boolean,
17+
defaultAction?: string,
18+
urlPrefix?: string,
19+
jwt?: {
2020
secret: any
2121
}
22-
, bodyParserUrlEncoded?: any
23-
, displayCols?: Array<number>
22+
bodyParserUrlEncoded?: any,
23+
displayCols?: Array<number>
2424
}
2525

2626
/**
@@ -34,7 +34,7 @@ export class Options {
3434
options.processdir = options.processdir || process.cwd();
3535
options.cors = options.cors || (options.hasOwnProperty("cors") ? options.cors : true);
3636
options.corsOptions = options.corsOptions || {};
37-
options.displayRoute = options.displayRoute || true;
37+
options.displayRoute = options.hasOwnProperty("displayRoute") ? options.displayRoute : true;
3838
options.defaultAction = options.defaultAction || "index";
3939
options.urlPrefix = options.urlPrefix || "";
4040
options.bodyParserUrlEncoded = options.bodyParserUrlEncoded || {extended: true};

0 commit comments

Comments
 (0)