Commit 4a2e5cc 1 parent 92ffbf5 commit 4a2e5cc Copy full SHA for 4a2e5cc
File tree 5 files changed +16
-2
lines changed
5 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ routes and handlers for incoming requests.
73
73
ciphers; however these can all be specified on httpsServerOptions.
74
74
- ` options.strictRouting ` ** [ Boolean] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean ) ** If set, Restify
75
75
will treat "/foo" and "/foo/" as different paths. (optional, default ` false ` )
76
+ - ` options.ignoreTrailingSlash ` ** [ Boolean] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean ) ** ignore trailing slash
77
+ on paths (optional, default ` false ` )
76
78
77
79
** Examples**
78
80
@@ -133,6 +135,8 @@ Creates a new Server.
133
135
ciphers; however these can all be specified on httpsServerOptions.
134
136
- ` options.noWriteContinue ` ** [ Boolean] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean ) ** prevents
135
137
` res.writeContinue() ` in ` server.on('checkContinue') ` when proxing (optional, default ` false ` )
138
+ - ` options.ignoreTrailingSlash ` ** [ Boolean] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean ) ** ignore trailing slash
139
+ on paths (optional, default ` false ` )
136
140
137
141
** Examples**
138
142
Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ The new version of restify never returns `RequestAbortedError`.
25
25
Option ` strictRouting ` is removed ` createServer({ strictRouting: false }) ` .
26
26
Strict routing is the new default.
27
27
28
+ ### Path trailing slash at the end
29
+
30
+ ` /path ` and ` /path/ ` are not the same thing in restify ` v7.x ` .
31
+ Use ` ignoreTrailingSlash: true ` server option if you don't want to differentiate
32
+ them from each other.
33
+
28
34
### Different ` RegExp ` usage in router path and wildcards
29
35
30
36
restify's new router backend
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ require('./errorTypes');
55
55
* ciphers; however these can all be specified on httpsServerOptions.
56
56
* @param {Boolean } [options.strictRouting=false] - If set, Restify
57
57
* will treat "/foo" and "/foo/" as different paths.
58
+ * @param {Boolean } [options.ignoreTrailingSlash=false] - ignore trailing slash
59
+ * on paths
58
60
* @example
59
61
* var restify = require('restify');
60
62
* var server = restify.createServer();
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ var ResourceNotFoundError = errors.ResourceNotFoundError;
33
33
* @param {Boolean } [options.strictNext=false] - Throws error when next() is
34
34
* called more than once, enabled onceNext option
35
35
* @param {Object } [options.registry] - route registry
36
- * @param {Object } [options.ignoreTrailingSlash] - ignore trailing slash on
37
- * paths
36
+ * @param {Boolean } [options.ignoreTrailingSlash=false ] - ignore trailing slash
37
+ * on paths
38
38
*/
39
39
function Router ( options ) {
40
40
assert . object ( options , 'options' ) ;
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ var PROXY_EVENTS = [
90
90
* ciphers; however these can all be specified on httpsServerOptions.
91
91
* @param {Boolean } [options.noWriteContinue=false] - prevents
92
92
* `res.writeContinue()` in `server.on('checkContinue')` when proxing
93
+ * @param {Boolean } [options.ignoreTrailingSlash=false] - ignore trailing slash
94
+ * on paths
93
95
* @example
94
96
* var restify = require('restify');
95
97
* var server = restify.createServer();
You can’t perform that action at this time.
0 commit comments