Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pages/getting-started/introduction-to-nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ server.listen(port, hostname, () => {
});
```

Both examples create the same HTTP server. The first uses the CommonJS module system (`require()`), while the second uses ECMAScript modules (`import`). Which one you use depends on your project's module system and configuration.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you include links?

@sumitjhacodes sumitjhacodes Aug 2, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I'll update the paragraph to include links to the CommonJS and ECMAScript modules documentation.

To run this snippet, save it as a `server.js` file and run `node server.js` in your terminal.
If you use the mjs version of the code, you should save it as a `server.mjs` file and run `node server.mjs` in your terminal.

Expand Down
Loading