https://github.com/spoonboy-io/dujour
A JSON/CSV Data Server. Creates a simple REST API for each file
https://github.com/spoonboy-io/dujour
csv golang json morpheus option-list server
Last synced: 16 days ago
JSON representation
A JSON/CSV Data Server. Creates a simple REST API for each file
- Host: GitHub
- URL: https://github.com/spoonboy-io/dujour
- Owner: spoonboy-io
- License: mpl-2.0
- Created: 2022-04-22T14:24:24.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-26T10:53:21.000Z (about 3 years ago)
- Last Synced: 2024-06-21T09:56:15.665Z (almost 2 years ago)
- Topics: csv, golang, json, morpheus, option-list, server
- Language: Go
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dujour
## A JSON/CSV Data File Server
[](https://go.dev/)
[](https://goreportcard.com/report/github.com/spoonboy-io/dujour)
[](https://github.com/spoonboy-io/dujour/actions/workflows/build.yml)
[](https://github.com/spoonboy-io/dujour/actions/workflows/unit_test.yml)
[](https://github.com/spoonboy-io/dujour/releases)
[](https://github.com/spoonboy-io/dujour/commits)
[](LICENSE)
## About
Dujour is a JSON/CSV data file server. It supports any usecase in which simple transformation of JSON and CSV data to a web
consumable JSON REST API is a requirement. Dujour was developed with Morpheus Option Lists in-mind, providing a way to host data for those lists, internally on the private network.
## Releases
You can find the [latest software here](https://github.com/spoonboy-io/dujour/releases/latest).
### Features
- Automatic self-signed TLS certificate (or use your own)
- Supports CSV files. Application will parse them to JSON
- Supports any number of JSON or CSV data files, memory being the only constraint
- Hot reload. New or edited data can be added with no server restart needed
- Data is served from memory. Fast
### Usage
Add `.json` and `.csv` data files to the `data` directory and Dujour will automatically load, validate and serve each data file at two REST API endpoints in JSON format.
In each data file, element/row data should contain an `id` key/column which should be unique in the dataset.
Data is loaded and served from an in-memory cache. No restart of the server is required when adding new data. Adding a new file of same name will cause the cache to be cleared and the data reloaded.
The filename of each data file determines the API endpoints which are created. For example, for a file named `users.json` (not case sensitive), Dujour will serve data at two endpoints:-
#### Get all users
This endpoint will retrieve all users:
```
GET $serverUrl:18651/users
```
#### Get a specific user
This endpoint will retrieve a specific user:
```
GET $serverUrl:18651/users/$id
```
### Installation
Grab the tar.gz or zip archive for your OS from the [releases page](https://github.com/spoonboy-io/dujour/releases/latest).
Unpack it to the target host, and then start the server.
```
./dujour
```
Or with nohup..
```
nohup ./dujour &
```
To update the application server, stop the server, replace the binary, then start the server.
### Limitations
- Dujour does not perform mutations on the data files. Only `GET` operations are supported.
### Development Opportunities
- Support CRUD operations on the data
- Run the application as a service
### License
Licensed under [Mozilla Public License 2.0](LICENSE)