Skip to content

Commit

Permalink
update code example
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Mar 31, 2024
1 parent 2ef1ab5 commit 150c7b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/posts/middleware-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ app.middleware((req, res, next) => {
return next();
}
res.writeHeader(401);
res.write("Unauthorized");
});

app.get("/", (_, res) => {
res.writeHeader(200);
res.write("Secret message");
});
```

Expand Down

0 comments on commit 150c7b1

Please sign in to comment.