Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oscarvalenzuela25/back-json-server-fake
Uso de Json-server para crear un endpoint para simular una API REST
https://github.com/oscarvalenzuela25/back-json-server-fake
json-server-fake project
Last synced: 12 days ago
JSON representation
Uso de Json-server para crear un endpoint para simular una API REST
- Host: GitHub
- URL: https://github.com/oscarvalenzuela25/back-json-server-fake
- Owner: oscarvalenzuela25
- Created: 2020-01-01T22:22:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-22T02:57:55.000Z (about 2 years ago)
- Last Synced: 2024-11-14T22:14:37.656Z (2 months ago)
- Topics: json-server-fake, project
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pasos para levantar JSON Server
### Instalar dependencia global
```
npm install -g json-server
```### Ahora creamos un archivo db.json, por ejemplo
```
{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
```### Levantamos nuestro server
```
json-server --watch db.json
```### Listo
Si vas al endpoint http://localhost:3000/posts/1 deberia de salirte
```
{ "id": 1, "title": "json-server", "author": "typicode" }
```### Documentación
[Link a Documentación](https://github.com/typicode/json-server)