Showing 1 changed files with 31 additions and 0 deletions
+31
README.md
... ...
@@ -519,6 +519,8 @@ Please follow [gitprep plugin documentation](https://sparrowhub.org/info/gitprep
519 519
 
520 520
 ## For Developers
521 521
 
522
+### Run GitPrep in development mode
523
+
522 524
 If you are a developer, you can start the application in development mode.
523 525
 
524 526
     ./morbo
... ...
@@ -533,6 +535,35 @@ If you have git, it is easy to install from git.
533 535
 
534 536
 It is useful to write configuration in ***gitprep.my.conf***, not gitprep.conf.
535 537
 
538
+### The way to create installable Mojolicious application
539
+
540
+GitPrep is the best example for developers who want to create installabel Mojolicious application.
541
+
542
+Even if shared hosting server, you can install Mojolicious application as CGI.
543
+
544
+**1. CGI is supported in Mojolicious
545
+
546
+It is good luck for us that Mojolicious author [Sebastian Riedel](https://twitter.com/kraih) decided to support CGI in Mojolicious.
547
+
548
+We can create web application which support CGI with a little effort.
549
+
550
+All you do is always using **url_for** method or **url_with** method in your templates when you write URL.
551
+
552
+    <a href="<%= url_for('/foo') %>">Bar</a>
553
+    
554
+    <a href="<%= url_with('/foo') %>">Bar</a>
555
+
556
+Mojolicious automatically resolve URL for both embded server and CGI.
557
+
558
+After that, you only prepare CGI script to call Mojolicious application in **production** mode.
559
+
560
+    #!/usr/bin/env perl
561
+    use FindBin;
562
+    use lib "$FindBin::Bin/extlib/lib/perl5";
563
+
564
+    $ENV{MOJO_MODE} = 'production';
565
+    require "$FindBin::Bin/script/gitprep";
566
+
536 567
 ## Web Site
537 568
 
538 569
 [GitPrep Web Site](http://gitprep.yukikimoto.com/)