Skip to content

An implementation of the Todo Backend using Clojure, yada, and Datomic.

License

Notifications You must be signed in to change notification settings

albertchan/yada-datomic-todomvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yada-datomic-todomvc

An implementation of the Todo Backend using Clojure, the yada web library, and Datomic.

Features

Have a look in project.clj for a more complete list of the dependencies. This project was tested in an environment running Java version 1.8.0_152.

Usage

After cloning the repo, you can run the project from the REPL or doing a cider-jack-in in Emacs.

cd yada-datomic
lein repl

Once the REPL starts, which may take a few minutes if you're running the project for the first time, type the following commands:

user> (dev)
dev> (go)

The server will start and listen on http://localhost:8000.

For development, you can also seed the database with some initial dummy data by running:

dev> (seed)

API Resources

Create a Todo

Method: POST Endpoint: /api/todos Example:

curl -i -H 'Content-Type:application/x-www-form-urlencoded' \
     -X POST -d "title=Get+some+green+eggs+and+ham&completed=false" \
     http://localhost:8000/api/todos

List Todos

Method: GET Endpoint: /api/todos/<uuid> Example:

curl -i -H "Accept:application/json" -H 'Content-Type:application/json' \
     -X GET http://localhost:8000/api/todos

Update a Todo

Method: POST Endpoint: /api/todos/<uuid> Example:

curl -i -H 'Content-Type:application/x-www-form-urlencoded' \
     -X PUT -d "title=Get+some+green+eggs+and+ham&completed=true" \
     http://localhost:8000/api/todos/<uuid>

References

Acknowledgements

I would like to thank my friend, Patrick Galvin, for getting me started and interested with Clojure and Datomic.

License

Copyright © 2017 Albert Chan

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

An implementation of the Todo Backend using Clojure, yada, and Datomic.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published