URL shortener: Difference between revisions
→{{header|Perl 6}}: bug fix, make more easily configurable
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: regularize whitespace) |
Thundergnat (talk | contribs) (→{{header|Perl 6}}: bug fix, make more easily configurable) |
||
Line 88:
$urlfile.IO.spurt(%urls.&to-json);
# Setup parameters
my $host = 'localhost';
my $port = 10000;
my $add-url-form = qq:to/HTML/;
<form action="http://
URL to add:<br><input type="text" name="url"></br>
<input type="submit" value="Submit"></form>
Line 102 ⟶ 106:
my $application = route {
post -> 'add_url' {
redirect :
request-body -> (:$url) { store $url }
}
Line 124 ⟶ 128:
my Cro::Service $shorten = Cro::HTTP::Server.new:
:host
$shorten.start;
|