Skip to content

Commit

Permalink
Merge pull request #2824 from bcgov/csv-streaming
Browse files Browse the repository at this point in the history
CSV streaming
  • Loading branch information
micheal-w-wells authored Aug 11, 2023
2 parents 34bf7be + e3dad75 commit 482bd3a
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 310 deletions.
36 changes: 36 additions & 0 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"node-fetch": "^2.6.7",
"object-path": "^0.11.8",
"pg": "~8.7.0",
"pg-cursor": "^2.10.1",
"pg-format": "^1.0.4",
"proj4": "^2.6.3",
"qs": "~6.9.7",
Expand Down Expand Up @@ -95,6 +96,7 @@
"@types/mocha": "~8.0.1",
"@types/node": "^17.0.23",
"@types/pg": "~7.14.4",
"@types/pg-cursor": "^2.7.0",
"@types/supertest": "^2.0.12",
"@types/uuid": "~8.3.0",
"@types/yamljs": "~0.2.31",
Expand Down
7 changes: 6 additions & 1 deletion api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ initialize({
message: 'unexpected error',
error: error?.message + error?.stack || error
});
if (!res.headersSent) {
// streaming responses cannot alter headers after dispatch
res.status(error.status || error.code || 500).json(error);
} else {

}

res.status(error.status || error.code || 500).json(error);
}
});

Expand Down
Loading

0 comments on commit 482bd3a

Please sign in to comment.