Skip to content

Commit 56b4ceb

Browse files
Update index.js
More Express Framework Example Update
1 parent fa08727 commit 56b4ceb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • examples/node-16-9-1/express-4-16-1/full_protection

examples/node-16-9-1/express-4-16-1/full_protection/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ router.use(crowdHandlerMiddleware);
4040

4141
// Route handler for all paths
4242
router.get("*", (req, res, next) => {
43+
//YOUR CODE BELOW THIS COMMENT
44+
4345
// Render the view and send the HTML
4446
res.render("index", { title: "hello" }, (err, html) => {
4547
// Handle any errors during rendering
4648
if (err) {
4749
return next(err);
4850
}
4951

50-
//YOUR CODE HERE
5152
res.send(html);
52-
//YOUR CODE HERE
5353

54-
// If the chGatekeeper instance exists in res.locals, record the performance
54+
// Don't forget to log performance data with CrowdHandler. This is used for reporting and the autotune feature.
5555
if (res.locals.chGatekeeper) {
5656
res.locals.chGatekeeper.recordPerformance();
5757
}

0 commit comments

Comments
 (0)