- install the elixir[https://elixir-lang.org/install.html]
- install the erlang[http://erlang.org/doc/installation_guide/INSTALL.html]
- install the phoenix framework[https://hexdocs.pm/phoenix/installation.html#content]
- Install dependencies with
mix deps.get - Install Node.js dependencies with
cd assets && npm install - Start Phoenix endpoint with
mix phx.server
Run Phoenix server first, then you can check them with url below
Check URL: localhost:4000/api/test
- To solve this problem, I used a recursive pattern. the core function located in json_controller
/lib/hello_web/json_controller.ex
Check URL: localhost:4000
-
/lib/hello_web/controllers/page_controller.ex- Render anindex.htmland pass the parameters from request. -
/lib/hello.ex- Declared the functionrepos({word, page, per_page})to call the github api. -
/lib/github_resultstream.ex- Github api implemented part. Call a api with url and manipulate body and header from github api. -
/lib/hello_web/views/page_view.ex- implemented functions which are relative with template file -
`/lib/hello_web/templates/page/index.html.eex - Index template for 10 by 10 table with pagination.