1
1
use v5.40;
2
+
2
3
package Minima v0.3.0;
4
+
5
+ use Minima::Setup;
6
+
7
+ sub init ($config = undef )
8
+ {
9
+ Minima::Setup::prepare($config );
10
+ \&Minima::Setup::init;
11
+ }
12
+
3
13
1;
4
14
5
15
__END__
@@ -12,8 +22,8 @@ Minima - Efficient web framework built with modern core classes
12
22
13
23
F<app.psgi>
14
24
15
- use Minima::Setup ;
16
- \& Minima::Setup ::init;
25
+ use Minima;
26
+ Minima::init;
17
27
18
28
For a "hello, world":
19
29
@@ -69,7 +79,7 @@ A typical web application using Minima operates as follows:
69
79
=item 1.
70
80
71
81
L<Minima::Setup> is loaded. It will read a configuration file (if any,
72
- see L<"Config File in Minima::Setup" |Minima::Setup/"CONFIG FILE"> ) and
82
+ see L<"Config File" in Minima::Setup|Minima::Setup/"CONFIG FILE"> ) and
73
83
provides a C<init > subroutine that is passed to Plack as the entry point
74
84
for receiving requests.
75
85
@@ -80,12 +90,12 @@ configuration.
80
90
81
91
=item 3.
82
92
83
- Minima::App passes a routes file (where all application routes are
93
+ L< Minima::App> passes a routes file (where all application routes are
84
94
defined) to L<Minima::Router> to be read and parsed.
85
95
86
96
=item 4.
87
97
88
- The request URL is matched to a route. Minima::App then calls the
98
+ The request URL is matched to a route. L< Minima::App> then calls the
89
99
appropriate controller and method, setting them up and passing along the
90
100
relevant information such as request and route data.
91
101
@@ -97,6 +107,29 @@ assigned to the response and finalized.
97
107
98
108
=back
99
109
110
+ =head1 GETTING STARTED
111
+
112
+ To begin a project, the Minima package provides a subroutine (described
113
+ below) to help you get started with the process mentioned above.
114
+
115
+ You can also interact directly with L<Minima::Setup> for full control
116
+ over the setup process.
117
+
118
+ =head2 init
119
+
120
+ sub init ($config = undef)
121
+
122
+ A convenience subroutine that calls
123
+ L<C<Minima::Setup::prepare> |Minima::Setup/prepare> to prepare the main
124
+ app object and returns a reference to
125
+ L<C<Minima::Setup::init> |Minima::Setup/init>.
126
+
127
+ The optional argument allows you to specify the location of the
128
+ configuration file.
129
+
130
+ For a detailed explanation of behavior and options, refer to the
131
+ documentation for L<Minima::Setup> .
132
+
100
133
=head1 EXAMPLE
101
134
102
135
Minima's repository contains an example application under F<eg/> . To run
0 commit comments