diff --git a/lib/package-server.js b/lib/package-server.js index 85da5de..0ac0c8a 100644 --- a/lib/package-server.js +++ b/lib/package-server.js @@ -236,11 +236,14 @@ function runApi(opts, router, req, res, next) { // TODO compile packagesMap // TODO people may want to use the framework in a non-framework way (i.e. to conceal the module name) router.packages.some(function (_route) { + if (!_route.api) { + return; + } + var pathname = router.pathname; if ('/' === pathname) { pathname = ''; } - // TODO allow for special apis that do not follow convention (.well_known, webfinger, oauth3.html, etc) if (!_route._api_re) { _route._api_re = new RegExp(escapeStringRegexp(pathname + '/api/' + _route.api.id) + '\/([\\w\\.\\-]+)(\\/|\\?|$)');