Skip to content

Commit

Permalink
limit error check added
Browse files Browse the repository at this point in the history
  • Loading branch information
Souravdey777 committed Jan 25, 2021
1 parent e7284a9 commit 2185c37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ app.get('/getLatestHashnodeBlog', async (request, response) => {
let limit = 3;
if (request.query.limit) {
limit = request.query.limit;
if (limit > 6) {
response.write(JSON.stringify({ error: 'limit parameters is more than 6!' }));
response.end();
}
}
const large = request.query.large === "true" ? true : false
const resultData = (await getLatestHashnodeBlog(username));
Expand Down

1 comment on commit 2185c37

@vercel
Copy link

@vercel vercel bot commented on 2185c37 Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.