https://github.com/blackmann/json
Custom JSON Placeholder server
https://github.com/blackmann/json
Last synced: about 1 month ago
JSON representation
Custom JSON Placeholder server
- Host: GitHub
- URL: https://github.com/blackmann/json
- Owner: blackmann
- Created: 2020-07-26T02:06:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T09:30:07.000Z (over 3 years ago)
- Last Synced: 2025-01-26T21:26:07.236Z (over 1 year ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### json
# Usage
Using an herokuish environment (Heroku/Dokku), just push to your remote.
Locally, run:
`yarn start` or `npm run start`
⚠ Make sure you installed packages (`yarn install`)
# Consuming API
Based on the directory structure of `./db` endpoints become valid. For example:
A call to `/authors/books` will look in the `./db` directory for `authors` folder then `books.json` and return that. You are free to nest the `./db` directory as deep as you want.
# Generating data
Generating dummies is easy. Extend the `Template` class and define your data structure and optionally the generation count, etc. Look at the `generators` dir for examples.
# Features
TODO
# Inspiration
When working on frontend projects, I usually use dummy json data to populate my views. There are 2 approaches for populating this data;
- By hand then upload to [jsonbin.io](https://jsonbin.io)
- Generate with [JSON Generator](https://next.json-generator.com) then copy to jsonbin then consume
I won't talk about the issue with generating by hand; but JSON Generator didn't feel intuitive enough for me. And the problem with `jsonbin` is that, when you update your JSON data, you get a different URL.
The URL `jsonbin` also provides is in the form of `/5e99697d5fa47104cea23c97`. A turn off.
Thus the birth of my json server