json-server
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
body-parser | 1.20.2 | 14.75 kB | MIT | prod | |
chalk | 4.1.2 | 11.31 kB | MIT | prod | |
compression | 1.7.4 | 7.64 kB | MIT | prod | |
connect-pause | 0.1.1 | 1.65 kB | MIT | prod | |
cors | 2.8.5 | 6.03 kB | MIT | prod | |
errorhandler | 1.5.1 | 5.75 kB | MIT | prod | |
express-urlrewrite | 1.4.0 | 2.61 kB | MIT | prod | |
express | 4.18.2 | 54.5 kB | MIT | prod | |
json-parse-helpfulerror | 1.0.3 | 2.66 kB | MIT | prod | |
lodash-id | 0.14.1 | 4.13 kB | MIT | prod | |
lodash | 4.17.21 | 311.49 kB | MIT | prod | |
lowdb | 1.0.0 | 10.7 kB | MIT | prod | |
method-override | 3.0.0 | 5.71 kB | MIT | prod | |
morgan | 1.10.0 | 9.37 kB | MIT | prod | |
nanoid | 3.3.7 | 5.42 kB | MIT | prod | |
please-upgrade-node | 3.2.0 | 2.73 kB | MIT | prod | |
pluralize | 8.0.0 | 5.89 kB | MIT | prod | |
server-destroy | 1.0.1 | 1.52 kB | ISC | prod | |
standard | 17.1.0 | 42.5 kB | MIT | prod | |
yargs | 17.7.2 | 64.15 kB | MIT | prod |
JSON Server is a versatile tool that creates a full fake REST API with zero coding, ideally in less than 30 seconds. It is ideal for front-end developers who need a quick back-end for prototyping and mocking. With its ability to generate an API that camouflages real server-side backed functionality, this tool streamlines the development process, saving time and energy.
Using JSON Server is a straightforward task, given its user-friendly nature. Let's break it down:
npm install -g json-server
db.json
file with some data:{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
json-server --watch db.json
After following these steps, the JSON Server will be up and running, ready for data requests.
The comprehensive documentation of JSON server is available in its GitHub repository: git://github.com/typicode/json-server.git
. The repository readme includes an outline of getting started with basic installation instructions, followed by details on topics such as Routes, Extras, CLI usage, and Modules. Each topic is comprehensively covered with clear explanations and code snippets adding to the understanding of each feature and functionality provided by the JSON server. The repository also provides links to related video tutorials and articles, augmenting the understanding of the npm package from various other resources.