4 ms·
Looks more like this... via http://mi.cro.services/ http://mi.cro.services/ use Cro::HTTP::Server; use Cro::HTTP::Router; my $app = route
by Ultimatt 9y ago
Looks more like this... via http://mi.cro.services/ http://mi.cro.services/
use Cro::HTTP::Server;
use Cro::HTTP::Router;
my $app = route {
get -> { content 'text/html', 'Hello World! ' ~ DateTime.now() }
}
my Cro::Service $service = Cro::HTTP::Server.new(
:host('localhost'), :port(9000), :$app
);
$service.start;
react whenever signal(SIGINT) {
$service.stop;
say "Goodbye!";
exit;
}