Newer Older
69 lines | 2.053kb
copy gitweblite soruce code
root authored on 2012-11-23
1
#!/usr/bin/env perl
2

            
3
use strict;
4
use warnings;
5

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
6
use FindBin;
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
7
BEGIN { unshift @INC, "$FindBin::Bin/../lib" }
copy gitweblite soruce code
root authored on 2012-11-23
8

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
9
use Getopt::Long qw(GetOptions :config no_auto_abbrev no_ignore_case);
copy gitweblite soruce code
root authored on 2012-11-23
10

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
11
GetOptions
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
12
  'h|help'     => \my $help,
13
  'l|listen=s' => \my @listen,
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
14
  'm|mode=s'   => sub { $ENV{MOJO_MODE} = $_[1] },
copy gitweblite soruce code
root authored on 2012-11-23
15
  'v|verbose'  => sub { $ENV{MORBO_VERBOSE} = 1 },
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
16
  'w|watch=s'  => \my @watch;
copy gitweblite soruce code
root authored on 2012-11-23
17

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
18
die <<EOF if $help || !(my $app = shift);
copy gitweblite soruce code
root authored on 2012-11-23
19
usage: $0 [OPTIONS] [APPLICATION]
20

            
21
  morbo script/myapp
22
  morbo myapp.pl
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
23
  morbo -m production -l https://*:443
copy gitweblite soruce code
root authored on 2012-11-23
24
  morbo -w /usr/local/lib -w public myapp.pl
25

            
26
These options are available:
27
  -h, --help                     Show this message.
28
  -l, --listen <location>        Set one or more locations you want to listen
29
                                 on, defaults to the value of MOJO_LISTEN or
30
                                 "http://*:3000".
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
31
  -m, --mode <name>              Operating mode for your application, defaults
32
                                 to the value of MOJO_MODE/PLACK_ENV or
33
                                 "development".
copy gitweblite soruce code
root authored on 2012-11-23
34
  -v, --verbose                  Print details about what files changed to
35
                                 STDOUT.
36
  -w, --watch <directory/file>   Set one or more directories and files to
37
                                 watch for changes, defaults to the
38
                                 application script as well as the "lib" and
39
                                 "templates" directories in the current
40
                                 working directory.
41
EOF
42

            
43
$ENV{MOJO_LISTEN} = join(',', @listen) if @listen;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
44
require Mojo::Server::Morbo;
copy gitweblite soruce code
root authored on 2012-11-23
45
my $morbo = Mojo::Server::Morbo->new;
46
$morbo->watch(\@watch) if @watch;
47
$morbo->run($app);
48

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
49
=encoding utf8
50

            
copy gitweblite soruce code
root authored on 2012-11-23
51
=head1 NAME
52

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
53
morbo - Morbo HTTP and WebSocket development server
copy gitweblite soruce code
root authored on 2012-11-23
54

            
55
=head1 SYNOPSIS
56

            
57
  $ morbo --help
58
  $ morbo myapp.pl
59

            
60
=head1 DESCRIPTION
61

            
62
Start L<Mojolicious> and L<Mojolicious::Lite> applications with the
63
L<Mojo::Server::Morbo> web server.
64

            
65
=head1 SEE ALSO
66

            
67
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
68

            
69
=cut