DDG::Rewrite - A (mostly spice related) Rewrite definition in our system
version 1017
my $rewrite = DDG::Rewrite->new( path => '/js/test/', to => 'http://some.api/$1', ); print $rewrite->nginx_conf; # location ^~ /js/test/ { # rewrite ^/js/test/(.*) /$1 break; # proxy_pass http://some.api:80/; # } my $missing_rewrite = DDG::Rewrite->new( path => '/js/test/', to => 'http://some.api/$1/?key={{ENV{DDGTEST_DDG_REWRITE_TEST_API_KEY}}}', ); if ($missing_rewrite->missing_envs) { ... } # is false if $ENV{DDGTEST_DDG_REWRITE_TEST_API_KEY} is not set
This class is used to contain a definition for a rewrite in our system. So far its specific designed for the problems we face towards spice redirects, but the definition is used in the App::DuckPAN test server. In the production system we use those definitions to generate an nginx config.
DuckDuckGo <open@duckduckgo.com>
This software is Copyright (c) 2013 by DuckDuckGo, Inc. https://duckduckgo.com/.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install DDG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DDG
CPAN shell
perl -MCPAN -e shell install DDG
For more information on module installation, please visit the detailed CPAN module installation guide.