openapi-connect
Version:
Base for microservices around OpenAPI/Swagger
27 lines • 759 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultOptions = void 0;
const url = require("url");
const getDefaultOptions = (basePath) => {
return {
enable: true,
path: [
url.resolve(basePath, 'api-docs'),
'/robots.txt',
'/health',
'/favicon.ico',
new RegExp(url.resolve(basePath, 'docs'), 'i')
]
};
};
exports.getDefaultOptions = getDefaultOptions;
exports.default = (basePath) => (options) => {
const defaultOptions = (0, exports.getDefaultOptions)(basePath);
return options
? {
...defaultOptions,
...options
}
: defaultOptions;
};
//# sourceMappingURL=unless.js.map