Skip to content

Commit

Permalink
Don't attempt to json encode string types
Browse files Browse the repository at this point in the history
  • Loading branch information
keslerm committed Oct 3, 2023
1 parent de210a8 commit a3ee02a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cli/src/routeGeneration/templates/express.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export function RegisterRoutes(app: Router) {
if (data && typeof data.pipe === 'function' && data.readable && typeof data._read === 'function') {
response.status(statusCode || 200)
data.pipe(response);
} else if (data && typeof data === "string") {
response.status(statusCode || 200).send(data);
} else if (data !== null && data !== undefined) {
response.status(statusCode || 200).json(data);
} else {
Expand Down

0 comments on commit a3ee02a

Please sign in to comment.