소스 검색

Add environment variable and snap configuration option for results per page

John Supplee 4 년 전
부모
커밋
9e8399612b
2개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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);
   }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
snap-src/bin/config


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.