1. Setup
elixir install 을 했다고 가정한다.
설치는 공식 문서 참고
1. postgresql
먼저 postgresql을 설치하고 실행해야 한다.
brew install postgresql@16
brew services start postgresql@16
2. phoenix
mix phx.new myNewServer
cd myNewServer
# 종속성 설치
mix deps.get
# ecto기반 db 생성
mix ecto.create
# 서버 실행
mix phx.server
# or 인터렉티브 서버 실행
# iex -S mix phx.server
mix ecto.create시 유저가 없다고 뜰 시
# postgresql 진입
psql
# 유저 생성 후 나가기, 그 후 다시 ecto.create 실행
=# CREATE ROLE postgres LOGIN CREATEDB;
=# \q