Skip to content

Commit

Permalink
Changing always middleware to require to be a function to register …
Browse files Browse the repository at this point in the history
…on `start()`
  • Loading branch information
avoidwork committed Feb 17, 2019
1 parent 484a859 commit a15f004
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ function bootstrap (obj) {
const routes = obj.config.routes.always || {};

each(Object.keys(routes), i => {
const fn = typeof routes[i] === "function" ? routes[i] : (req, res) => res.send(routes[i]);

obj.always(i, fn).blacklist(fn);
if (typeof routes[i] === "function") {
obj.always(i, routes[i]).blacklist(routes[i]);
}
});

delete obj.config.routes.always;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an HTTP/HTTP2 REST API framework",
"version": "10.3.0",
"version": "10.3.1",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit a15f004

Please sign in to comment.