sudo apt-get install inotify-tools #ubuntu
sudo apt-get install postgresql #Ubuntu
mix local.hex #install hex
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez #phoenix archive
mix phoenix.new hello_phoenix
cd hello_phoenix
#configure your database in config/dev.exs
mix ecto.create
mix phoenix.server #Run Application
iex -S mix phoenix.server #Run Interactive Elixir
iex -S mix
mix compile #Compile all
http://localhost:4000
- web/router.ex
- get "/hello", HelloController, :index
- resources "/users", UserController
- web/controllers/hello_controller.ex #controller
- web/views/hello_view.ex #view
- web/templates/hello/index.html.eex #template
- web/views/layout_view.ex #layout
- phoenix.gen.json {params} or phoenix.gen.json {params}
- mix ecto.migrate
mix test
iex -S mix test --trace
#require IEx
#IEx.pry
#IO.puts foo
$ mix help | grep -i phoenix
mix phoenix.digest # Digests and compress static files
mix phoenix.gen.channel # Generates a Phoenix channel
mix phoenix.gen.html # Generates controller, model and views for an HTML based resource
mix phoenix.gen.json # Generates a controller and model for a JSON based resource
mix phoenix.gen.model # Generates an Ecto model
mix phoenix.new # Create a new Phoenix v1.1.2 application
mix phoenix.routes # Prints all routes
mix phoenix.server # Starts applications and their servers
$ mix help | grep -i ecto
mix ecto.create # Create the storage for the repo
mix ecto.drop # Drop the storage for the repo
mix ecto.gen.migration # Generate a new migration for the repo
mix ecto.gen.repo # Generates a new repository
mix ecto.migrate # Runs migrations up on a repo
mix ecto.rollback # Reverts migrations down on a repo
mix run priv/repo/seeds.exs