Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrschumacher/json-data-server
A simple json data server which concats a collection of json files into one large file
https://github.com/jrschumacher/json-data-server
Last synced: about 2 hours ago
JSON representation
A simple json data server which concats a collection of json files into one large file
- Host: GitHub
- URL: https://github.com/jrschumacher/json-data-server
- Owner: jrschumacher
- Created: 2015-02-13T12:25:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-20T10:55:51.000Z (over 7 years ago)
- Last Synced: 2024-10-09T22:22:16.035Z (about 1 month ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON data server
A simple data server.
## Routes
### GET /version
Get the current version of the data. This is a simple md5 hash of the data.
**Response:** `"a213efa9530a382e9c097e2c4872c3cd"`
### GET /version?is=123456...
A simple test to see if the version is the same.
**Response:** `true|false`
### GET /data
Get the data structure. The datastructure is stored as json files. There is only one special file `index.json`. This file is a an index of all other files.
Assuming a structure like this
- index.json
- events.json
- page.jsonThen index.json would look like
```
[ "events", "page" ]
```And the resulting data
```
{
"events": ...,
"page": ...
}
```## Run Server
To run the server you will need to
```
$ npm install
$ node index.js
```By default the remote host is set to `localhost` and the remote path is `''`. If you need to set these:
```
$ node REMOTE_PATH=/json REMOTE_HOST=my.server.com index.js
```