モチベーション
- とりあえず触ってみたかっただけ
- 気が向いたらそれ以降も書く
前提条件
- OSX 10.10.5
- Homebrew 0.9.5
- Elixir 1.0.5
- PostgreSQL 9.4.4
インストールまで
$ brew install elixir
$ elixir -v
Elixir 1.0.5
$ brew install postgresql
$ createdb # データベース追加
$ createuser postgres # postgresユーザを追加
$ psql
(username)=\# ALTER USER postgres CREATEDB; # DB作成できるように
$ mix local.hex # パッケージマネージャー hexをインストール
$ mix phoenix.new ./practice_phoenix
$ cd ./practice_phoenix
$ mix ecto.create
$ mix phoenix.server
[info] Running PracticePhoenix.Endpoint with Cowboy on http://localhost:4000
30 Aug 18:56:08 - info: compiled 5 files into 2 files, copied 3 in 2181ms
mix phoenix.*
mix phoenix タスクリストを見てみる
$ mix help | grep 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.gen.secret # Generates a secret
mix phoenix.new # Create a new Phoenix v1.0.0 application
mix phoenix.routes # Prints all routes
mix phoenix.server # Starts applications and their servers