https://github.com/djblue/record-keeper
The keeper of records.
https://github.com/djblue/record-keeper
clojure rest-api
Last synced: 6 months ago
JSON representation
The keeper of records.
- Host: GitHub
- URL: https://github.com/djblue/record-keeper
- Owner: djblue
- Created: 2019-12-11T05:10:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-12T06:57:57.000Z (about 6 years ago)
- Last Synced: 2025-03-12T20:48:47.440Z (10 months ago)
- Topics: clojure, rest-api
- Language: Clojure
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# record-keeper
[](https://travis-ci.org/djblue/record-keeper)
[](https://coveralls.io/github/djblue/record-keeper?branch=master)
## Assumptions
- No records are duplicated.
- No record fields need to be escaped.
- Assume birthdays are always formatted MM/DD/YYYY
## CLI
To run the cli, do:
clojure -A:cli [...files]
For example, at the root of this project, do:
clojure -A:cli gender resources/example.comma resources/example.pipe resources/example.space
## REST API
Alongside the CLI is a JSON REST API with the following methods:
- POST /records - Post a single data line in any of the 3 formats
supported by your existing code
- [GET /records/gender](http://localhost:3000/records/gender) - returns
records sorted by gender
- [GET /records/birthdate](http://localhost:3000/records/birthdate) -
returns records sorted by birthdate
- [GET /records/name](http://localhost:3000/records/name) - returns
records sorted by name
To run the server, do:
clojure -A:server
To post data to the API, do:
curl --data-binary @path/to/file -X POST http://localhost:3000/records
For example, at the root of this project, do:
curl --data-binary @resources/example.comma -X POST http://localhost:3000/records
## Tests
To run project tests, do:
clojure -A:test