Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nodejs.md #208

Merged
merged 2 commits into from
May 3, 2024
Merged
Changes from all commits
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
21 changes: 20 additions & 1 deletion en/server-side/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ This should print the version number of Node.js like this:
```bash
v20.7.0
```
## Node.js REPL

REPL is a command line interface that stands for Read Evaluate Print Loop, which enables you to run code from the terminal. To get started, type the following command into your terminal:

```bash
node
```
Once you enter this prompt, you can run code, like this:

```js
> console.log("Hello World")
```
You can leave the REPL by typing CTRL + d
Arnalv marked this conversation as resolved.
Show resolved Hide resolved

## Writing your first Node.js program

Expand All @@ -51,7 +64,13 @@ Hello World!

Express is a popular web framework for Node.js. It provides a simple and elegant API for building web applications. Let's use Express to create a simple web server that will respond to HTTP requests with a "Hello World!" message.

First, we need to install Express. To do this, run the following command in your terminal:
First, we need to initialize npm by running npm init.

```bash
npm init
```

Then, install express

```bash
npm install express
Expand Down
Loading