GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Toadfarm::Manual::DSL(3) User Contributed Perl Documentation Toadfarm::Manual::DSL(3)

Toadfarm::Manual::DSL - Domain specific language for Toadfarm

This manual gives an overview of which functions are available when building a Toadfarm script.

These functions are exported to the caller namespace by default. See "SYNOPSIS" in Toadfarm for example usage.

  $app = app;

Used to fetch the Toadfarm / Mojolicious instance that the rest of the functions below are using.

  change_root qw(--userspec www-data:www-data /path/to/jail);

Used to change user/group and root directory. Note that this require the Toadfarm script to be started as "root", but it also requires that the underlying "chroot" command result in changing the user. Not changing the effective user from "root" (UID=0) will result in an infinite loop.

This function is experimental and subject to change.

See also "sudo".

  logging {
    combined => 0,
    path     => "/path/to/log/file.log",
    level    => "info",
  };

Used to set up Mojo::Log. See "path" in Mojo::Log and "level" in Mojo::Log for details on the accepted values. "combined" can be set to true to make all the mounted apps use the same Mojo::Log object.

  mount "/path/to/mojo-app" => \%config;
  mount "My::Mojo::App" => \%config;
  mount "My::Mojo::App";

This function will mount a Mojolicious application in the Toadfarm application. An application can either be a full path to the application or a class name. The apps are processed in the order they are defined. This means that the first app that match a given rule will receive the request.

See Toadfarm::Manual::Config for details on %config.

An application without %config is considered to be a "catch all" application, meaning that it will get all the requests that do not match any of the above.

  plugin "My::Mojo::Plugin" => \%config;
  plugin "AccessLog";

Used to load a Mojolicious::Plugin. In addition to the default Mojolicious::Plugin namespace, this application will also search in the "Toadfarm::Plugin::" namespace.

  run_as $uid;
  run_as $username;

Use "sudo" (might change) to force the script to be run as a given user.

See also "change_root".

  secrets @str;

Used to set application "secrets" in Mojolicious. A random secret will be set if none is specified.

Note: This function is experimental and might be removed in future release.

  start;
  start \@listen, %config;
  start %config;

Used to start the application. Both @listen and %config are optional, but will be used to specify the "SETTINGS" in Mojo::Server::Hypnotoad.

These three examples do the same thing:

  # 1.
  start proxy => 1;
  # 2.
  start ["http://*:8080"], {proxy => 1};
  # 3.
  start {listen => ["http://*:8080"], proxy => 1};

See also Toadfarm::Manual::Intro.

Jan Henning Thorsen - "jhthorsen@cpan.org"
2019-09-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.