Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 2dae79a Oct 1, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Simpler error handling Oct 1, 2015
.editorconfig Initial commit, send back json Sep 29, 2015
.gitignore Initial commit, send back json Sep 29, 2015
Cargo.lock Add a macro to get pg connection from req Sep 30, 2015
Cargo.toml Add some db interaction (select *) Sep 29, 2015
Makefile Add some db interaction (select *) Sep 29, 2015
README.md Slightly better README Sep 30, 2015

README.md

Testing rust for web services

Using rustc 1.5.0-nightly (6108e8c3e 2015-09-28). The Makefile will create/start/remove a docker instance of postgres.

$ make create && make start
$ cargo run

The server lives on localhost:5000 and the only url is http://localhost:5000/passwords.

Get

Will return all the passwords in the db in JSON format.

$ curl http://localhost:5000/passwords 

Post

Will insert a password in the db and return 201

$ curl -X POST -v -d '{"id": 42, "name": "hey", "encrypted": "hey"}' http://localhost:5000/passwords

You can’t perform that action at this time.