You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Step 1.2** Install [express-generator](https://www.npmjs.com/package/express-generator) globally `-g` with [npm](https://docs.npmjs.com/cli/install)
11
-
**Step 1.3** Check that the `express` command works by using the `-h` help option
9
+
1. Install [Node.js](https://nodejs.org/)
10
+
2. Install [express-generator](https://www.npmjs.com/package/express-generator) globally `-g` with [npm](https://docs.npmjs.com/cli/install)
11
+
3. Check that the `express` command works by using the `-h` help option
12
12
13
13
```
14
14
npm install -g express-generator
15
15
express -h
16
16
```
17
17
18
-
## 2. Create an express project
18
+
## Step 2. Create an Express Project
19
19
20
-
**Step 2.1** Open a [command line interface](https://en.wikipedia.org/wiki/Command-line_interface):
20
+
### 2.1 Open a Command Line Interface (CLI)
21
+
22
+
Open a [command line interface](https://en.wikipedia.org/wiki/Command-line_interface) or terminal:
21
23
22
24

23
25
24
-
**Step 2.2** Create an express project with the `express` command, replacing `<project_name>` with the name of your project:
26
+
### 2.2 Generate a Project Folder with the express Command
27
+
28
+
Create an express project with the `express` command, replacing `<project_name>` with the name of your project:
25
29
26
30
*`<project_name>` should be a valid folder name with no spaces and starting with a letter
27
31
28
32
```
29
33
express <project_name>
30
34
```
31
35
32
-
**Step 2.3** A folder named `<project_name>` will be created with the following structure inside (note that the structure may change with `express --version` that is not 4.16.0):
36
+
### 2.3 Inspect the Project Folder Structure
37
+
38
+
A folder named `<project_name>` will be created with the following structure inside (note that the structure may change with `express --version` that is not 4.16.0):
*`app.js`: JavaScript file that contains code needed to create and run your express server or application
50
56
*`package.json`: [JSON](https://www.json.org/) structured [package file](https://docs.npmjs.com/files/package.json) holding all the dependencies and information about your project (can be modified with the [npm](https://docs.npmjs.com/cli/npm) command)
51
57
52
-
##
58
+
## Step 3. Install Project Dependencies
59
+
60
+
### 3.1 Change directory
61
+
62
+
Move into the project folder, where `<project_name>` is the name of the folder you created in [Step 2.2](#step-22-generate-a-project-folder-with-the-express-command):
63
+
64
+
```
65
+
cd <project_name>
66
+
```
67
+
68
+
### 3.2 Install express Dependencies
69
+
70
+
Inside your `<project_name>` folder, install the dependencies with `npm`, where a folder called `/node_modules` will contain the code files of the installed dependencies:
71
+
72
+
```
73
+
npm install
74
+
```
75
+
76
+
### 3.3 Install leaflet as a Dependency
77
+
78
+
Install leaflet with `npm install` and save it as a dependency `--save` to `package.json`:
79
+
80
+
```
81
+
npm install --save leaflet
82
+
```
83
+
84
+
## Step 4. Creating a leaflet Map
85
+
86
+
Create a file for the leaflet map by sending an empty line with `echo` into `>` a file called `webmap.js`:
0 commit comments