-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathindex.html.ep
211 lines (165 loc) · 9.57 KB
/
index.html.ep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
% layout 'default';
<h1>Purpose</h1>
<ul>
<li><a href="http://tempi.re/mojolicious-full-and-lite-apps-understanding-the-difference">Introduction</a></li>
<li>Compare a <a href="https://github.com/tempire/MojoExample/">full Mojolicious app</a> to a <a href="https://github.com/tempire/MojoExample/blob/master/mojolite">lite app</a> with the same functionality.</li>
<li>See an example of DBIx::Class usage with Mojolicious</li>
<li>See an example of tests for a Mojolicious app</li>
</ul>
<h2>Notes</h2>
<ul>
<li>Both apps make use of the DBIx::Class schema.</li>
<li>The schema is in lib/Schema.pm, lib/Schema/*</li>
<li>The DBIx::Class schema connects to a provided sqlite3 database, test.db</li>
<li>The controller tests create a new test.db, populated using fixtures from t/fixtures/*</li>
<li>The schema tests use an in-memory sqlite3 database, populated using fixtures
from t/fixtures/*</li>
<li>Test::Database is a utility for populating the sqlite3 databases with
fixtures from t/fixtures/*</li>
</ul>
<h1>Usage</h1>
<h2>Live</h2>
<p><a href="http://mojoexample.herokuapp.com/">Running on Heroku</a></p>
<p>Heroku is running Hypnotoad, the <em>full featured UNIX optimized preforking
non-blocking I/O HTTP 1.1 and WebSocket server built around the very well
tested and reliable Mojo::Server::Daemon with IPv6, TLS, Bonjour, libev
and hot deployment support that just works</em>.</p>
<p>To easily deploy your own Mojolicious app to Heroku, check out <a href="http://tempire.github.com/mojolicious-command-deploy-heroku">Deploy Perl Mojolicious web apps to Heroku</a>.</p>
<h2>Locally</h2>
<p>A minimum of Perl 5.10 is required. If your Perl is too old, <a href="http://perlbrew.pl/">Perlbrew</a> is über easy to install!</p>
<p>If you <em>must</em> run on Perl 5.8, you can try a <a href="https://github.com/jamadam/mojo-legacy">back-ported version of Mojolicious</a>, but you're on your own :)</p>
<h3>Install</h3>
<pre><code>git clone [email protected]:tempire/MojoExample.git
cd MojoExample
</code></pre>
<p>Install the Carton package manager. Carton will install all dependencies
to the local/ sub-directory.</p>
<pre><code>curl -L cpanmin.us | perl - Carton
carton install
</code></pre>
<h3>Run</h3>
<h4>Full app</h4>
<pre><code>carton exec morbo script/mojo_full
</code></pre>
<h4>Light app</h4>
<pre><code>carton exec morbo mojolite
</code></pre>
<h1>Index</h1>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib">lib/</a>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/MojoFull.pm">MojoFull.pm</a> - Mojolicious Application</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/MojoFull">MojoFull/</a> - Mojolicious Controllers
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/MojoFull/Blogs.pm">Blogs.pm</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/MojoFull/Home.pm">Home.pm</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/MojoFull/Photos.pm">Photos.pm</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema.pm">Schema.pm</a> - DBIx::Class model</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema">Schema/</a>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/Result">Result/</a> - DBIx::Class Result classes
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/Result/Blog.pm">Blog.pm</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/Result/BlogTag.pm">BlogTag.pm</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/Result/Photo.pm">Photo.pm</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/Result/Photoset.pm">Photoset.pm</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/ResultSet/">ResultSet/</a> - DBIx::Class ResultSet classes
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/ResultSet/Blog.pm">Blog.pm</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/ResultSet/Photo.pm">Photo.pm</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Schema/ResultSet/Photoset.pm">Photoset.pm</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Test/">Test/</a>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/lib/Test/Database.pm">Database.pm</a> - Utility class for populating test fixtures</li>
</ul>
</li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/">public/</a> - Static files
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/css/">css/</a>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/css/main.css">main.css</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/images/">images/</a>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/images/background.gif">background.gif</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/images/bender_promo.png">bender_promo.png</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/images/box-bottom.png">box-bottom.png</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/images/box-middle.gif">box-middle.gif</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/images/box-top.png">box-top.png</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/public/images/profile_top.png">profile_top.png</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/script/">script/</a> - Utilities
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/script/generate_schema">generate_schema</a> - Generates DBIx::Class schema from database file</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/script/mojo_full">mojo_full*</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/script/new_db">new_db</a> - Generates database file from DBIx::Class and fixtures</li>
</ul>
</li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/">t/</a> - Tests
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/fixtures/">fixtures/</a> - Fixtures (placeholder data) for tests
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/fixtures/Blog.pl">Blog.pl</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/fixtures/Photoset.pl">Photoset.pl</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/schema/">schema/</a> - DBIx::Class model tests
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/schema/blog.t">blog.t</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/schema/blog_tag.t">blog_tag.t</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/schema/photo.t">photo.t</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/schema/photoset.t">photoset.t</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/home.t">home.t</a> - Home.pm controller tests</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/blogs.t">blogs.t</a> - Blogs.pm controller tests</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/t/photos.t">photos.t</a> - Photos.pm controller tests</li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/">templates/</a>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/blogs/">blogs/</a> - Blogs.pm templates
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/blogs/index.html.ep">index.html.ep</a> - Tag Helpers</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/blogs/show.html.ep">show.html.ep</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/home/">home/</a> - Home.pm templates
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/home/index.html.ep">index.html.ep</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/photos/">photos/</a> - Photos.pm templates
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/photos/index.html.ep">index.html.ep</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/photos/show.html.ep">show.html.ep</a></li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/photos/show_set.html.ep">show_set.html.ep</a></li>
</ul>
</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/layouts/">layouts/</a>
<ul>
<li><a href="https://github.com/tempire/MojoExample/blob/master/templates/layouts/default.html.ep">default.html.ep</a></li>
</ul>
</li>
</ul>
</li>
<li><em><a href="https://github.com/tempire/MojoExample/blob/master/mojolite">mojolite</a></em> - Mojolicious::Lite app, with all the application files listed above embedded</li>
<li><a href="https://github.com/tempire/MojoExample/blob/master/README.md">README.md</a> - This file</li>
</ul>
<h1>Copyright License</h1>
<p>Copyright (C) 2008-2014, Glen Hinkle.</p>
<p>MojoExample is free software, you can redistribute it and/or modify it under the same terms as Perl5 (http://dev.perl.org/licenses/).</p>