Skip to content

Commit

Permalink
handle multi routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 22, 2019
1 parent 1b11c97 commit 542ce8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ OpenApiMiddleware.prototype.install = function(app: ExpressApp) {
OpenApiMiddleware.prototype.middleware = function() {
return (req, res, next) => {
const { path: rpath, method, route } = req;
const path = route.path || rpath;
var path = Array.isArray(route.path)
? route.path.find(() => rpath)
: route.path || rpath;
if (path && method) {
// TODO add option to enable undocumented routes to pass through without 404
const documentedRoute = this.routeMap[path];
Expand Down

0 comments on commit 542ce8a

Please sign in to comment.