summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2017-12-09 16:35:04 +0100
committerYorhel <git@yorhel.nl>2017-12-09 16:35:08 +0100
commitaff3a2174c919da117ae41386dca825910775a36 (patch)
treeec046222b4fd552809be7c8b44b47c8972c2820d /examples
parentba6da0074d4bd7c5e4a557eed2212daeff473148 (diff)
Add a default-exported tuwf() DSL-like function
Another inspiration from Dancer2. While Dancer2 exports a whole bunch of such functions, TUWF's functionality is already mostly contained in a single object, so a single function will do nicely.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/singlefile.pl7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/singlefile.pl b/examples/singlefile.pl
index 267a0ed..226127f 100755
--- a/examples/singlefile.pl
+++ b/examples/singlefile.pl
@@ -71,15 +71,14 @@ sub subpage {
$self->resHeader('Content-Type' => 'text/plain; charset=UTF-8');
lit $uri;
lit "\n";
- lit $self->capture(1);
+ lit tuwf->capture(1);
lit "\n";
- lit $self->capture('capturename');
+ lit tuwf->capture('capturename');
}
sub echoapi {
- my $self = shift;
- $self->resJSON($self->reqJSON);
+ tuwf->resJSON(tuwf->reqJSON);
}