Hello World Wide Web⚓︎
In this tutorial we'll create a very simple web app and verify that it displays text in a web browser.
Set Up PNPM⚓︎
Install pnpm to manage installed node versions.
While pnpm is great at managing other packages used by your project, we'll keep this simple by using no external dependencies other than node itself.
curl -fsSL https://get.pnpm.io/install.sh | sh -
Install Node⚓︎
Node.js allows us to implement a server application in javascript.
pnpm env use --global 24
Add Source⚓︎
Create a new file index.js and paste the following code.
| index.js | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Code taken from An Example Node.js Application.
Run the App⚓︎
pnpx node index.js
Output
Server running at http://127.0.0.1:3000/
Viewing in Browser⚓︎
Open http://127.0.0.1:3000/ in a web browser.
