This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(petster_hello_controller, [Request]). | |
-compile(export_all). | |
world('GET', []) -> | |
{output, "This is not a hello world"}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./init-dev.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{db_host, "localhost"}, | |
{db_port, 5432}, | |
{db_adapter, pgsql}, | |
{db_username, "petster"}, | |
{db_database, "petster_dev"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boss_migrate:make(petster, pets). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Migration: pets | |
{pets, | |
fun(up) –> undefined; | |
(down) –> undefined | |
end}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Migration: pets | |
UpSQL = " | |
CREATE TABLE pets( | |
id serial unique, | |
name text not null, | |
species text not null | |
); | |
". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boss_migrate:run(petster). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
–module(pet, [Id, Name, Species]). | |
–compile(export_all). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
–module(petster_pet_controller, [Request]). | |
–compile(export_all). | |
index('GET', []) –> | |
Pets = boss_db:find(pet, []), | |
{ok, [{pets, Pets}]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Petster</title> | |
</head> | |
<body> | |
{% block content %}{% endblock %} | |
</body> | |
</html> |