Skip to content

💧 ReposFind - List repositories from github using an authenticated user - Ignite Elixir - @Rocketseat

Notifications You must be signed in to change notification settings

daphnecarvalho/ignite-elixir-consumindo-apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReposFind - Challenge: Consuming APIs

Instructions: Consumindo APIs, Testando requisições com bypass, Autenticação JWT and Token refresh.

Base URL

http://localhost:4000/

Routes

/api/users

  • [GET] /
    • ReposFindWeb.UsersController :index
  • [POST] /sigin
    • ReposFindWeb.UsersController :sign_in
  • [GET] /signout
    • ReposFindWeb.UsersController :sign_out
  • [GET] /current_token
    • ReposFindWeb.UsersController :current_token
  • [GET] /:id
    • ReposFindWeb.UsersController :show
  • [POST] /
    • ReposFindWeb.UsersController :create
  • [PATCH] /:id
    • ReposFindWeb.UsersController :update
  • [PUT] /:id
    • ReposFindWeb.UsersController :update
  • [DELETE] /:id
    • ReposFindWeb.UsersController :delete

/api/repos

  • [GET] /
    • ReposFindWeb.RepositoriesController :index
  • [GET] /:username
    • ReposFindWeb.RepositoriesController :show

Tests

Tests: 9 total

Project commands

Prepare project

  # Intall dependencies
  mix deps.get

  # Start PostgreSQL service
  service postgresql start

  # Reset migrations
  mix ecto.reset
  MIX_ENV=test mix ecto.reset 

  # View app routes
  mix phx.routes

Run project

  # Start Phoenix server
  mix phx.server

Run tests

  # Intall dependencies
  mix test

  # Check coverage of tests
  mix test --cover

Phoenix Server

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser. Ready to run in production? Please check our deployment guides.

Learn more