Skip to content

Commit be8dfaa

Browse files
committed
Add install dependencies
1 parent fa7e811 commit be8dfaa

File tree

1 file changed

+48
-9
lines changed

1 file changed

+48
-9
lines changed

README.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,38 @@ Richard Wen <rwen@ryerson.ca>
44

55
A tutorial for creating a leaflet webmap with express in Node.js
66

7-
## 1. Install Software
7+
## Step 1. Install Software
88

9-
**Step 1.1** Install [Node.js](https://nodejs.org/)
10-
**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
1212

1313
```
1414
npm install -g express-generator
1515
express -h
1616
```
1717

18-
## 2. Create an express project
18+
## Step 2. Create an Express Project
1919

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:
2123

2224
![command_line](images/command_line.gif)
2325

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:
2529

2630
* `<project_name>` should be a valid folder name with no spaces and starting with a letter
2731

2832
```
2933
express <project_name>
3034
```
3135

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):
3339

3440
![project_structure](images/project_structure.png)
3541

@@ -49,4 +55,37 @@ express <project_name>
4955
* `app.js`: JavaScript file that contains code needed to create and run your express server or application
5056
* `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)
5157

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`:
87+
88+
```
89+
echo > webmap.js
90+
```
91+

0 commit comments

Comments
 (0)