chore(docs): remove express code examples
Check List
- [x] I have read the Contributing Guidelines and made commit messages that follow the guideline.
- [x] I have run
npm run lint:js -- --fixand/ornpm run lint:md -- --fixfor my JavaScript and/or Markdown changes.- This is important as most of the cases your code changes might not be correctly linted
- [x] I have run
npm run testto check if all tests are passing, and/ornpm run test -- -uto update snapshots if I created and/or updated React Components. - [x] I have checked that the build works locally and that
npm run buildandnpm run build-storybookwork fine. - [x] I've covered new added functionality with unit tests if necessary.
Description
Remove express.js code examples from "How to exit from a Node.js program" and "Get HTTP request body data using Node.js".
Related Issues
Fixes #1584
Codecov Report
Merging #2615 (9c04111) into main (1b08e05) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## main #2615 +/- ##
=======================================
Coverage 87.47% 87.47%
=======================================
Files 87 87
Lines 1006 1006
Branches 272 272
=======================================
Hits 880 880
Misses 120 120
Partials 6 6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
I don't think this should be removed.
Why? express.js is probably the most popular way of creating APIs with node.js
express.js is probably the most popular way of creating APIs with node.js
Being agnostic on the examples with pure Node.js would be an unbiased way of giving examples, but that doesn't mean we could also add express.js examples and other framework examples.
E.g., alongside the node.js http ones, we could add a code snippet example for express.js and fastify. On the node-request-data doc. The node-terminate-program happens to use an http program, but it could use just a plain `while´ loop as that doc explains how gracefully kill node.js programs.
@araujogui could you rebase the PR and update the branch with the requested changes?
express.js is probably the most popular way of creating APIs with node.js
Being agnostic on the examples with pure Node.js would be an unbiased way of giving examples, but that doesn't mean we could also add express.js examples and other framework examples.
E.g., alongside the node.js
httpones, we could add a code snippet example forexpress.jsandfastify. On thenode-request-datadoc. Thenode-terminate-programhappens to use anhttpprogram, but it could use just a plain `while´ loop as that doc explains how gracefully kill node.js programs.
In node-terminate-program, I think the HTTP server example would be more common and useful in the real world and illustrate better the importance of a graceful shutdown.
A loop example feels too generic to me and it doesn't self-explain well why should you care about graceful shutdowns
const timer = setInterval(() => {
console.log("Hello, loops!");
}, 1000);
process.on("SIGTERM", () => {
console.log("Received SIGTERM signal");
clearInterval(timer);
});
This pull request is stale because it has been open for 30 days with no activity.
This pull request was closed because it has been inactive for 14 days since being marked as stale.