Skip to content
This repository was archived by the owner on Feb 18, 2019. It is now read-only.

sergeysova/instaclone-backend.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instaclone Backend

Installation

  1. Open rustup.rs and follow instructions
  2. Install Rust 1.26 (nightly)
  3. Install PostgreSQL ^9.6.5
  4. Create db instaclone: CREATE DATABASE instaclone; or change connection in .env
  5. Install diesel.rs: cargo install diesel_cli
  6. Migrate database: diesel migration run
  7. Review Rocket.toml
  8. Start app: cargo run

Authorization

Send token in header Authorization: Token asdqwezxc.

Where asdqwezxc is your token received from POST /session.

GET /session

Get info about current session.

Response:

{
  "data": {
    "id": 123,
    "username": "foo"
  }
}

POST /session

Create new token. Log in.

Receive:

{
  "login": "string",
  "password": "string"
}

Response:

{
  "data" {
    "token": "asdqwezxc"
  }
}

DELETE /session

Destroy current token. Log out.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors