Yesod + Postgresで、stack exec -- yesod develができるところまで
はじめに
この記事はYesodでpostgreSQLを使う Haskell stackを参考にしました。参考にした記事をこえる内容はありません。自分用のまとめです。
前提
システムにStackやPostgreSQLはインストールずみであるとします。事前にYesod + sqliteでのテストをしてあるものとします。また、PostgreSQLは起動ずみとします。
Yesodのプロジェクトの名前
ここではYesodのプロジェクトの名前をtestYesodとします。
必要なユーザの作成
% psql -U postgres -d postgres
# create user "testYesod" password 'testYesod';
# create user "testYesod_LOWER" password 'testYesod';
必要なデータベースの作成
# create database "testYesod_LOWER" owner "testYesod";
# create database "testYesod_LOWER_test" owner "testYesod";
# \q
Yesodのプロジェクトの作成とテスト
# stack new testYesod yesod-postgres && cd testYesod
# stack build
# stack exec -- yesod devel
これで、http://localhost:3000にアクセスするとデフォルトのYesodのページを見ることができる。
# stack test
...
10 examples, 0 failures