Skip to content

Commit

Permalink
chore(release): 2.3.2 [skip ci]
Browse files Browse the repository at this point in the history
## [2.3.2](v2.3.1...v2.3.2) (2023-02-24)

### Bug Fixes

* make it faster ([417cedf](417cedf))
  • Loading branch information
semantic-release-bot committed Feb 24, 2023
1 parent 417cedf commit 586c667
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.3.2](https://github.com/ClearC2/headlamp/compare/v2.3.1...v2.3.2) (2023-02-24)


### Bug Fixes

* make it faster ([417cedf](https://github.com/ClearC2/headlamp/commit/417cedf96adf9ac557e82aec0356c556dba49bd7))

## [2.3.1](https://github.com/ClearC2/headlamp/compare/v2.3.0...v2.3.1) (2023-02-24)


Expand Down
12 changes: 6 additions & 6 deletions lib/api-route-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ function _default(app) {
});
var responseStore = createActivationStore();
var customResponseStore = createCustomResponseStore();
var fileRoutes = getFileRoutes(options);

function getAllRouteResponses(routeId) {
var fileRoute = getFileRoutes(options).find(function (r) {
var fileRoute = fileRoutes.find(function (r) {
return r.id === routeId;
});
var fileResponses = getRouteResponses(options, fileRoute);
Expand All @@ -91,7 +92,7 @@ function _default(app) {
} // create routes from files


getFileRoutes(options).forEach(function (route) {
fileRoutes.forEach(function (route) {
// create express route
var appRoute = app.route(route.path); // add methods to route

Expand Down Expand Up @@ -129,7 +130,6 @@ function _default(app) {

warnDuplicateRoutes(app);
app.get('/_api', function (req, res) {
var fileRoutes = getFileRoutes(options);
var routes = getAPIRoutes(app).map(function (r) {
// attempt to find route file for route
var routeFile = fileRoutes.find(function (route) {
Expand Down Expand Up @@ -336,7 +336,7 @@ function _default(app) {
});
app.get('/_route/:routeId/responses', function (req, res) {
var routeId = req.params.routeId;
var fileRoute = getFileRoutes(options).find(function (r) {
var fileRoute = fileRoutes.find(function (r) {
return r.id === routeId;
}) || {};
var responses = getAllRouteResponses(routeId);
Expand All @@ -350,7 +350,7 @@ function _default(app) {
var _req$params = req.params,
routeId = _req$params.routeId,
respId = _req$params.respId;
var fileRoute = getFileRoutes(options).find(function (r) {
var fileRoute = fileRoutes.find(function (r) {
return r.id === routeId;
});
var responses = getAllRouteResponses(routeId);
Expand All @@ -366,7 +366,7 @@ function _default(app) {
});
app.get('/_route/:routeId/responses/deactivate', function (req, res) {
var routeId = req.params.routeId;
var fileRoute = getFileRoutes(options).find(function (r) {
var fileRoute = fileRoutes.find(function (r) {
return r.id === routeId;
});
responseStore.setActiveResponse(routeId, null);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clearc2/headlamp",
"version": "2.3.1",
"version": "2.3.2",
"description": "Express API documenter",
"main": "lib/index.js",
"publishConfig": {
Expand Down

0 comments on commit 586c667

Please sign in to comment.