Browse Source

Add environment variable and snap configuration option for results per page

John Supplee 4 years ago
parent
commit
9e8399612b
2 changed files with 5 additions and 0 deletions
  1. 5 0
      server/publications/cards.js
  2. 0 0
      snap-src/bin/config

+ 5 - 0
server/publications/cards.js

@@ -461,6 +461,11 @@ function buildProjection(query) {
     skip = query.params.skip;
   }
   let limit = DEFAULT_LIMIT;
+  const configLimit = parseInt(process.env.RESULTS_PER_PAGE, 10);
+  if (!isNaN(configLimit) && configLimit > 0) {
+    limit = configLimit;
+  }
+
   if (query.params.hasOperator(OPERATOR_LIMIT)) {
     limit = query.params.getPredicate(OPERATOR_LIMIT);
   }

File diff suppressed because it is too large
+ 0 - 0
snap-src/bin/config


Some files were not shown because too many files changed in this diff