Skip to content

A JSON/CSV Data Server. Creates a simple REST API for each file

License

Notifications You must be signed in to change notification settings

spoonboy-io/dujour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dujour

A JSON/CSV Data File Server

GitHub go.mod Go version Go Report Card GitHub Workflow Status GitHub Workflow Status (branch) GitHub Release Date GitHub commits since latest release (by date) GitHub

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.

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.

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