Amon2を使ってみる
一発目
とりあえず、perlbrew, cpanmをインストーしたサーバーを用意
%cpanm Amon2 #installつけるの忘れた ...いろいろinstall... Building and testing Amon2-3.32 ... OK Successfully installed Amon2-3.32 42 distributions installed
あれ、一発で終わってしまった。
perl-5.14.2入れたからか、モジュールのupdateもいらなかった。
次は、まず"Hello world!"かな
Hello World!
便利なスクリプトがついてくるので、それを使う
%which amon2-setup.pl ~/perl5/perlbrew/perls/perl-5.14.2/bin/amon2-setup.pl #はいってることが確認できたので %amon2-setup.pl MyApp -- Running flavor: Basic -- [Flavor::Basic] Loading asset: jQuery [Flavor::Basic] Loading asset: Bootstrap ......
ここで出てくる、flavorとは作りたいアプリケーションの規模とか、
機能によってよしなにやってくれるやつらしい
参考:http://perl-users.jp/articles/advent-calendar/2011/amon2/2
起動
%cd MyApp %plackup app.psgi Error while loading app.psgi: Can't locate DBI.pm in @INC,,,, # DBIが無いらしい % cpanm Amon2/Plugin/DBI.pm Error .... #足りないものをいれ、再度plackup! %plackup app.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/
あとは、http://hostname:5000にアクセスすると!
"Hello Amon2 World!"
となりました。
mysqlをつかいたい
あとでやる。きょうはここまで。