https://github.com/bqardi/stupid-simple-api
A stupidly simple API. Just serving simple JSON files.
https://github.com/bqardi/stupid-simple-api
api json
Last synced: over 1 year ago
JSON representation
A stupidly simple API. Just serving simple JSON files.
- Host: GitHub
- URL: https://github.com/bqardi/stupid-simple-api
- Owner: bqardi
- License: mit
- Created: 2023-01-08T01:34:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-16T05:43:31.000Z (over 3 years ago)
- Last Synced: 2025-01-15T15:52:09.703Z (over 1 year ago)
- Topics: api, json
- Homepage: https://bqardi.github.io/stupid-simple-api/
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stupid-simple-api
A stupidly simple API. Just serving simple JSON files.
# Why?
I did this to see for myself if it was possible.
I also learned why we don't do it this way but use a server instead.
## So why shouldn't we do it this way, when it is so easy and simple?
Well, for practice purposes or for quickly serving up some dummy data that ultimately needs to be replaced before production anyway, it is perfectly fine to do it this way.
But, imagine, for example, we have data for thousands of restaurants, and each restaurant has loads of data:
- info about the restaurant
- info about employees
- menu(s), with detailed info about each meal
- location
- whatever
We are dealing with hundreds of thousands of lines of data here.
Say we need to fetch data for one restaurant to get info about their location?
To get that info we would need to fetch ALL data for ALL restaurants, and then filter the data to get the info we need!
Say the size of the data is 1MB but data for the location of that one restaurant is only 1KB, that is a lot of unnecessary data we are sending across the internet.
To get around that we need a server that can filter the data before we send it!
So to say it very basically; we don't do this for performance reasons.
Thank you for reading this :-)