Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/conscious-puppet/book-store
simple crud app using Servant Haskell that utilises the NamedRoutes
https://github.com/conscious-puppet/book-store
haskell servant
Last synced: 14 days ago
JSON representation
simple crud app using Servant Haskell that utilises the NamedRoutes
- Host: GitHub
- URL: https://github.com/conscious-puppet/book-store
- Owner: conscious-puppet
- License: mit
- Created: 2023-06-11T07:25:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-22T15:20:53.000Z (over 1 year ago)
- Last Synced: 2023-10-05T18:44:45.338Z (over 1 year ago)
- Topics: haskell, servant
- Language: Haskell
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# book-store
## Routes
```
@route GET /version
@desc App version@route GET /healthcheck
@desc Healthcheck API@route GET /books
@desc Get all books
@resp
[
{
"id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
"name": "The Heart Is a Lonely Hunter",
"author": "Carson McCullers"
},
{
"id": "01136e18-a56e-420a-8e2c-db3319745255",
"name": "The Lord of the Rings",
"author": "J. R. R. Tolkien"
}
]@route GET /books/:id
@desc Get a book by id
@resp
{
"id": "01136e18-a56e-420a-8e2c-db3319745255",
"name": "The Lord of the Rings",
"author": "J. R. R. Tolkien"
}@route POST /books
@desc Create a new book
@req
{
"name": "Heart Is a Lonely Hunter",
"author": "Carson McCullers"
}
@resp
{
"id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
"name": "Heart Is a Lonely Hunter",
"author": "Carson McCullers"
}@route POST /books
@desc Update a book by id
@req
{
"id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
"name": "The Heart Is a Lonely Hunter",
"author": "Carson McCullers"
}
@resp
{
"id": "52302b94-5241-4cac-ad1a-6d42c73a93ee",
"name": "The Heart Is a Lonely Hunter",
"author": "Carson McCullers"
}@route DELETE /books/:id
@desc Delete a book by id
@resp NoContent
```## TODOs:
- add proper error response message
- send confirmation if delete was successful
- updating a non-existant book results in nothing, should throw an error