Skip to content

Instantly share code, notes, and snippets.

@msroot
Created October 25, 2016 22:13
Show Gist options
  • Save msroot/09b4733b6bb4308b35d4a5a2fbecdc8c to your computer and use it in GitHub Desktop.
Save msroot/09b4733b6bb4308b35d4a5a2fbecdc8c to your computer and use it in GitHub Desktop.

PhoenixBlog

##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

Install node dependencies

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

Start Phoenix endpoint with

mix phoenix.server

Now you can visit localhost:4000 from your browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment