Toadfarm 0.77

One Mojolicious app to rule them all

Homepage: https://github.com/jhthorsen/toadfarm

Platform: CPAN

Language: Perl

License: Artistic-2.0

View on registry: https://metacpan.org/release/Toadfarm


NAME

Toadfarm - One Mojolicious app to rule them all

VERSION

0.77

DESCRIPTION

Toadfarm is a module for configuring and starting your Mojolicious applications. You can either combine multiple applications in one script, or just use it as a init script.

Core features:

  • Wrapper around hypnotoad that makes your application Sys-V compatible.
  • Advanced routing and virtual host configuration. Also support routing from behind another web server, such as nginx. This feature is very much like Mojolicious::Plugin::Mount on steroids.
  • Hijacking log messages to a common log file. There's also plugin, Toadfarm::Plugin::AccessLog, that allows you to log the requests sent to your server.

SYNOPSIS

Script

Here is an example script that sets up logging and mounts some applications under different domains, as well as loading in some custom plugins.

See Toadfarm::Manual::DSL for more information about the different functions.

  #!/usr/bin/perl
  use Toadfarm -init;

  logging {
    combined => 1,
    file     => "/var/log/toadfarm/app.log",
    level    => "info",
  };

  mount "MyApp"  => {
    Host   => "myapp.example.com",
    config => {
      config_parameter_for_myapp => "foo"
    },
  };

  mount "/path/to/app" => {
    Host        => "example.com",
    mount_point => "/other",
  };

  mount "Catch::All::App";

  plugin "Toadfarm::Plugin::AccessLog";

  start; # needs to be at the last line

Usage

You don't have to put "Script" in init.d, but it will work with standard start/stop actions.

  $ /etc/init.d/your-script reload
  $ /etc/init.d/your-script start
  $ /etc/init.d/your-script stop

See also "Init script" in Toadfarm::Manual::RunningToadfarm for more details.

You can also start the application with normal Mojolicious commands:

  $ morbo /etc/init.d/your-script
  $ /etc/init.d/your-script daemon

DOCUMENTATION INDEX

PLUGINS

PREVIOUS VERSIONS

Toadfarm prior to version 0.49 used to be a configuration file loaded in by the toadfarm script. This resulted in all the executables to be named toadfarm instead of something descriptive. It also felt a bit awkward to take over MOJO_CONFIG and use all the crazy hacks to start hypnotoad.

It also didn't work well as an init script, so there still had to be a seperate solution for that.

The new Toadfarm DSL aim to solve all of these issues. This means that if you decide to still use any MOJO_CONFIG, it should be for the applications loaded from inside Toadfarm and not the startup script.

Note that the old solution still works, but a warning tells you to change to the new DSL based API.

COPYRIGHT AND LICENSE

Copyright (C) 2014, Jan Henning Thorsen

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

AUTHOR

Jan Henning Thorsen - [email protected]


Configure Dependencies Requirements Latest Stable Latest Release Licenses
ExtUtils-MakeMaker 0 7.24 Artistic-1.0-Perl
Explore the resolved configure dependency tree for Toadfarm 0.77
Dependencies Requirements Latest Stable Latest Release Licenses
File-Which 1.00 1.21 Artistic-1.0-Perl
Mojolicious 7.18 7.29 Artistic-2.0
Explore the resolved dependency tree for Toadfarm 0.77
Build Dependencies Requirements Latest Stable Latest Release Licenses
Test-More 0.88
Explore the resolved build dependency tree for Toadfarm 0.77

Dependent Projects

See all dependent projects

Releases

  • 0.77 - February 20, 2017 16:05
  • 0.76 - February 17, 2017 15:29
  • 0.75 - August 03, 2016 14:12
  • 0.74 - March 10, 2016 21:31
  • 0.73 - February 24, 2016 22:22
  • 0.72 - January 02, 2016 23:15
  • 0.71 - November 30, 2015 09:25
  • 0.70 - November 27, 2015 10:52
  • 0.69 - October 28, 2015 11:42
  • 0.68 - October 09, 2015 17:05
See all 73 releases

Project Statistics

SourceRank 9
Dependencies 2
Dependent projects 1
Dependent repositories 0
Total releases 73
Latest release
First release
Stars 7
Forks 7
Watchers 2
Contributors 5
Repo Size: 348 KB

Top Contributors See all

Jan Henning Thorsen Stefan Adams William Lindley David Steinbrunner Zoffix Znet

Something wrong with this page? Make a suggestion

Export .ABOUT file for this library

Last synced: 2017-02-23 01:05:22 UTC

Login to resync this project