DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Build a Website with Phoenix


Phoenix 是一个基于 Elixir 的Web框架,按照 http://www.phoenixframework.org/docs/up-and-running, 运行mix phoenix.new hello_world后询问是否安装依赖,选择Y, mix执行running mix deps.get时长时间没有响应。 Ctrl-C中断,进入hello_world文件夹后运行mix deps.get,一段时间后报超时错误, 加代理后重新执行顺利完成。

在Ubuntu上安装PostgreSQL,安装后, 根据"config/prod.secret.exs",可知要创建数据库"hello_world_prod ":

su - postgres
psql
create database hello_world_prod owner postgres;

安装后用sudo passwd postgres将用户postgres密码设置为postgres,

sudo chown leo:leo readable-stream
npm install
mix phoenix.server

在另一个Console中执行vi web/templates/page/index.html.eex,重启phoenix服务, 可以看到修改后的效果。

Note: mix ecto.create可以跳过。



Published

Mar 2, 2016

Last Updated

Jan 2, 2019

Category

Tech

Tags

  • phoenix 1
  • web 16

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor