Search code examples
node.jsswaggerhapi.js

Hapi Swagger skip certain endpoints


Since the npm module hapi-swagger doesn't support file upload endpoints I need a way to skip certain endpoints in my tests.

I've checked the docs and there's no beforeEach or any way to check which endpoint is which during the test runs.

Currently I've just got my environment set to TEST and have an if in the target handler but that's messy and complicated.

Is there any way to skip endpoints?


Solution

  • I am not quite sure of what you are trying to achieve above. The use of tags can create groups of endpoints. Its often used for pre-release or beta groupings. This maybe of use to you.

    The latest version of hapi-swagger now also supports basic file uplaods, so you maybe able skip this issue.

    Both tags and file uploads are cover in the project readme and code examples of there use can be found in the https://github.com/glennjones/be-more-hapi project.