Skip to content

Commit 8ad02ba

Browse files
authored
Update README.md
1 parent 9acab68 commit 8ad02ba

File tree

1 file changed

+0
-79
lines changed

1 file changed

+0
-79
lines changed

README.md

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,10 @@
1-
# json-server
2-
3-
[![Node.js CI](https://github.com/typicode/json-server/actions/workflows/node.js.yml/badge.svg)](https://github.com/typicode/json-server/actions/workflows/node.js.yml)
4-
5-
> [!IMPORTANT]
6-
> Viewing beta v1 documentation – usable but expect breaking changes. For stable version, see [here](https://github.com/typicode/json-server/tree/v0)
7-
8-
👋 _Hey! Using React, Vue or Astro? Check my new project [MistCSS](https://github.com/typicode/mistcss) to write 50% less code._
91

102
## Install
113

124
```shell
135
npm install json-server
146
```
157

16-
## Usage
17-
18-
Create a `db.json` or `db.json5` file
19-
20-
```json
21-
{
22-
"posts": [
23-
{ "id": "1", "title": "a title", "views": 100 },
24-
{ "id": "2", "title": "another title", "views": 200 }
25-
],
26-
"comments": [
27-
{ "id": "1", "text": "a comment about post 1", "postId": "1" },
28-
{ "id": "2", "text": "another comment about post 1", "postId": "1" }
29-
],
30-
"profile": {
31-
"name": "typicode"
32-
}
33-
}
34-
```
35-
36-
<details>
37-
38-
<summary>View db.json5 example</summary>
39-
40-
```json5
41-
{
42-
posts: [
43-
{ id: '1', title: 'a title', views: 100 },
44-
{ id: '2', title: 'another title', views: 200 },
45-
],
46-
comments: [
47-
{ id: '1', text: 'a comment about post 1', postId: '1' },
48-
{ id: '2', text: 'another comment about post 1', postId: '1' },
49-
],
50-
profile: {
51-
name: 'typicode',
52-
},
53-
}
54-
```
558

569
You can read more about JSON5 format [here](https://github.com/json5/json5).
5710

@@ -76,32 +29,6 @@ $ curl http://localhost:3000/posts/1
7629

7730
Run `json-server --help` for a list of options
7831

79-
## Sponsors ✨
80-
81-
| Sponsors |
82-
| :---: |
83-
| <a href="https://mockend.com/" target="_blank"><img src="https://jsonplaceholder.typicode.com/mockend.svg" height="100px"></a> |
84-
| <a href="https://zuplo.link/json-server-gh"><img src="https://github.com/typicode/json-server/assets/5502029/928b7526-0fdf-46ae-80d9-27fa0ef5f430"></a> |
85-
86-
| Sponsors |
87-
| :---: |
88-
| <a href="https://konghq.com/products/kong-konnect?utm_medium=referral&utm_source=github&utm_campaign=platform&utm_content=json-server"><img src="https://github.com/typicode/json-server/assets/5502029/e8d8ecb2-3c45-4f60-92d0-a060b820fa7f" height="75px"></a> |
89-
90-
| Sponsors | |
91-
| :---: | :---: |
92-
| <a href="https://www.storyblok.com/" target="_blank"><img src="https://github.com/typicode/json-server/assets/5502029/c6b10674-4ada-4616-91b8-59d30046b45a" height="35px"></a> | <a href="https://betterstack.com/" target="_blank"><img src="https://github.com/typicode/json-server/assets/5502029/44679f8f-9671-470d-b77e-26d90b90cbdc" height="35px"></a> |
93-
| <a href="https://route4me.com"><img src="https://github.com/user-attachments/assets/4eab0bac-119e-4b27-8183-8b136190b776" height="35px" alt="Delivery Routing Software and Route Optimization Software"></a> | <a href="https://www.speechanddebate.org"><img src="https://github.com/user-attachments/assets/cc7980e4-2147-4499-8de4-4d0c265d0c07" height="35px"></a> |
94-
95-
96-
[Become a sponsor and have your company logo here](https://github.com/users/typicode/sponsorship)
97-
98-
## Sponsorware
99-
100-
> [!NOTE]
101-
> This project uses the [Fair Source License](https://fair.io/). Only organizations with 3+ users are kindly asked to contribute a small amount through sponsorship [sponsor](https://github.com/sponsors/typicode) for usage. __This license helps keep the project sustainable and healthy, benefiting everyone.__
102-
>
103-
> For more information, FAQs, and the rationale behind this, visit [https://fair.io/](https://fair.io/).
104-
10532
## Routes
10633

10734
Based on the example `db.json`, you'll get the following routes:
@@ -201,9 +128,3 @@ You can also add custom directories using `-s/--static` option.
201128
json-server -s ./static
202129
json-server -s ./static -s ./node_modules
203130
```
204-
205-
## Notable differences with v0.17
206-
207-
- `id` is always a string and will be generated for you if missing
208-
- use `_per_page` with `_page` instead of `_limit`for pagination
209-
- use Chrome's `Network tab > throtling` to delay requests instead of `--delay` CLI option

0 commit comments

Comments
 (0)