Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/_api/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ routes and handlers for incoming requests.
ciphers; however these can all be specified on httpsServerOptions.
- `options.strictRouting` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If set, Restify
will treat "/foo" and "/foo/" as different paths. (optional, default `false`)
- `options.ignoreTrailingSlash` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore trailing slash
on paths (optional, default `false`)

**Examples**

Expand Down Expand Up @@ -133,6 +135,8 @@ Creates a new Server.
ciphers; however these can all be specified on httpsServerOptions.
- `options.noWriteContinue` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** prevents
`res.writeContinue()` in `server.on('checkContinue')` when proxing (optional, default `false`)
- `options.ignoreTrailingSlash` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore trailing slash
on paths (optional, default `false`)

**Examples**

Expand Down
6 changes: 6 additions & 0 deletions docs/guides/6to7guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ The new version of restify never returns `RequestAbortedError`.
Option `strictRouting` is removed `createServer({ strictRouting: false })`.
Strict routing is the new default.

### Path trailing slash at the end

`/path` and `/path/` are not the same thing in restify `v7.x`.
Use `ignoreTrailingSlash: true` server option if you don't want to differentiate
them from each other.

### Different `RegExp` usage in router path and wildcards

restify's new router backend
Expand Down
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ require('./errorTypes');
* ciphers; however these can all be specified on httpsServerOptions.
* @param {Boolean} [options.strictRouting=false] - If set, Restify
* will treat "/foo" and "/foo/" as different paths.
* @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash
* on paths
* @example
* var restify = require('restify');
* var server = restify.createServer();
Expand Down
4 changes: 2 additions & 2 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ var ResourceNotFoundError = errors.ResourceNotFoundError;
* @param {Boolean} [options.strictNext=false] - Throws error when next() is
* called more than once, enabled onceNext option
* @param {Object} [options.registry] - route registry
* @param {Object} [options.ignoreTrailingSlash] - ignore trailing slash on
* paths
* @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash
* on paths
*/
function Router(options) {
assert.object(options, 'options');
Expand Down
2 changes: 2 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ var PROXY_EVENTS = [
* ciphers; however these can all be specified on httpsServerOptions.
* @param {Boolean} [options.noWriteContinue=false] - prevents
* `res.writeContinue()` in `server.on('checkContinue')` when proxing
* @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash
* on paths
* @example
* var restify = require('restify');
* var server = restify.createServer();
Expand Down