TODO源代码:https://github.com/vessi/chicago-todo/
使用Chicago Boss 0.88 - 下载: http://www.chicagoboss.org/download.htm
1. 创建todo项目:
在Chicago boss目录内,运行:make app PROJECT=todo
2. 会退到上级目录,进入todo项目目录。
3. 修改boss.config文件,找到{server, cowboy},改为{server, mochiweb}
注意: Chicago Boss 0.88 默认使用cowboy做服务器,但笔者使用cowboy无法启动服务。
4. 项目中加入各层代码:
controllers: https://github.com/vessi/chicago-todo/tree/master/src/controller
models: https://github.com/vessi/chicago-todo/tree/master/src/model
views: https://github.com/vessi/chicago-todo/tree/master/src/view/home
其他libs: https://github.com/vessi/chicago-todo/tree/master/src/lib
5. 修改/priv/todo.routes文件,在底部加入:{"/", [{controller, "home"}, {action, "home"}]}.
6. 添加static文件:https://github.com/vessi/chicago-todo/tree/master/priv/static
7. 启动项目: ./init-dev.sh, 访问: http://localhost:8001/