informatica:linux:json-server
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | informatica:linux:json-server [2020/02/25 20:51] (current) – created jose | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== json-server ====== | ||
+ | https:// | ||
+ | |||
+ | Create a db.json file with some data | ||
+ | |||
+ | < | ||
+ | |||
+ | { | ||
+ | " | ||
+ | { " | ||
+ | ], | ||
+ | " | ||
+ | { " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | json-server --watch db.json | ||
+ | |||
+ | Tenemos 3 categorías, | ||
+ | |||
+ | Para ver posts: | ||
+ | |||
+ | curl http:// | ||
+ | < | ||
+ | [ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | </ | ||
+ | |||
+ | Si queremos añadir uno: | ||
+ | curl -H " | ||
+ | |||
+ | |||
informatica/linux/json-server.txt · Last modified: 2020/02/25 20:51 by jose