Skip to content

rpereira/example-servant-persistent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is a small example for how to set up a web-server with servant-server that uses persistent for saving data to a database.

You can build and run the project with stack, e.g.:

stack build
stack exec example-servant-persistent

Then you can query the server:

# POST /users
curl --request POST --header "Content-Type: application/json" \
    --data '{"username": "alice", "email": "alice@me.com", "password": "ninjas"}' \
    http://localhost:3000/users

# GET /users/:username
curl --request GET --header "Content-Type: application/json" \
    http://localhost:3000/users/alice

About

Simple example to illustrate how to use persistent and servant in combination.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 100.0%