https://github.com/drmick/haskell-rest-api
Haskell Rest API
https://github.com/drmick/haskell-rest-api
haskell
Last synced: over 1 year ago
JSON representation
Haskell Rest API
- Host: GitHub
- URL: https://github.com/drmick/haskell-rest-api
- Owner: drmick
- Created: 2022-03-29T14:49:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-01T15:14:38.000Z (over 4 years ago)
- Last Synced: 2025-02-10T02:41:27.541Z (over 1 year ago)
- Topics: haskell
- Language: Haskell
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Haskell Rest API
#### Build
```
docker-compose build
```
#### Run
```
docker-compose up
```
#### Use
```
# Register new user
curl -X POST -H "Content-Type: application/json" -d '{"username": "scott", "password": "tiger"}' http://localhost:3000/sign_up
# Add Book
curl -u scott:tiger -X POST -H "Content-Type: application/json" -d '{"title": "Crime and punishment"}' http://localhost:3000/books/
# List Books
curl -u scott:tiger -X GET -H "Content-Type: application/json" http://localhost:3000/books/
# Get Book
curl -u scott:tiger -X GET -H "Content-Type: application/json" http://localhost:3000/books/1
# Update Book
curl -u scott:tiger -X PUT -H "Content-Type: application/json" -d '{"title": "War and Peace"}' http://localhost:3000/books/1
# Delete Book
curl -u scott:tiger -X DELETE -H "Content-Type: application/json" http://localhost:3000/books/1
```