Skip to content

Instantly share code, notes, and snippets.

@kan
Created October 5, 2012 07:06
Show Gist options
  • Select an option

  • Save kan/3838484 to your computer and use it in GitHub Desktop.

Select an option

Save kan/3838484 to your computer and use it in GitHub Desktop.
今日の電波
use WAF::Casual;
sub index {
# render HTML
return "hello world";
}
sub json {
req my $self, $x, $y;
# render json API
return { result => $x + $y };
}
1;
__END__
<html>
<head><title>test</title></head>
<body>$body</body>
</html>
% plackup ./hoge.pl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment