Skip to content

Commit 350cd67

Browse files
authored
Update README.md
1 parent e6fdcc3 commit 350cd67

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ See also:
2020
<!-- toc -->
2121

2222
- [Sponsorship](#sponsorship)
23-
- [Example](#example)
24-
- [Install](#install)
23+
- [Getting started](#getting-started)
2524
- [Routes](#routes)
2625
* [Plural routes](#plural-routes)
2726
* [Singular routes](#singular-routes)
@@ -63,7 +62,13 @@ See also:
6362

6463
</details>
6564

66-
## Example
65+
## Getting started
66+
67+
Install JSON Server
68+
69+
```
70+
npm install -g json-server
71+
```
6772

6873
Create a `db.json` file
6974

@@ -82,7 +87,7 @@ Create a `db.json` file
8287
Start JSON Server
8388

8489
```bash
85-
$ json-server --watch db.json
90+
json-server --watch db.json
8691
```
8792

8893
Now if you go to [http://localhost:3000/posts/1](http://localhost:3000/posts/1), you'll get
@@ -98,12 +103,6 @@ Also when doing requests, it's good to know that:
98103
- Id values are not mutable. Any `id` value in the body of your PUT or PATCH request will be ignored. Only a value set in a POST request will be respected, but only if not already taken.
99104
- A POST, PUT or PATCH request should include a `Content-Type: application/json` header to use the JSON in the request body. Otherwise it will result in a 200 OK but without changes being made to the data.
100105

101-
## Install
102-
103-
```bash
104-
$ npm install -g json-server
105-
```
106-
107106
## Routes
108107

109108
Based on the previous `db.json` file, here are all the default routes. You can also add [other routes](#add-custom-routes) using `--routes`.

0 commit comments

Comments
 (0)