##Create a new app with a mysql driver mix phoenix.new phoenix_blog --database mysql
##Create the db
mysql -u root
CREATE DATABASE phoenix_blog_dev
##Install dependencies mix deps.get
##Migrate the db mix ecto.create && mix ecto.migrate
npm install
##Generate a scaffold mix phoenix.gen.html Post posts title body:text
##Edit routes at web/router.ex scope "/", PhoenixBlog do get "/", PostController, :index resources "/posts", PostController end
mix phoenix.server
Now you can visit localhost:4000
from your browser
No comments:
Post a Comment