- Open rustup.rs and follow instructions
- Install Rust 1.26 (nightly)
- Install PostgreSQL ^9.6.5
- Create db instaclone:
CREATE DATABASE instaclone;or change connection in.env - Install diesel.rs:
cargo install diesel_cli - Migrate database:
diesel migration run - Review
Rocket.toml - Start app:
cargo run
Send token in header Authorization: Token asdqwezxc.
Where asdqwezxc is your token received from POST /session.
Get info about current session.
Response:
{
"data": {
"id": 123,
"username": "foo"
}
}Create new token. Log in.
Receive:
{
"login": "string",
"password": "string"
}Response:
{
"data" {
"token": "asdqwezxc"
}
}Destroy current token. Log out.