#!perl
BEGIN { $ENV{CATALYST_ENGINE} = 'Server' }
use strict;
use FindBin;
use lib 'lib';
use Devel::ebug;
use Devel::ebug::HTTP;

my $port = 8080;
my $filename = shift;
die "Usage: ebug_httpng filename\n" unless $filename;

my $ebug = Devel::ebug->new();
$ebug->program($filename);
$ebug->load;
$Devel::ebug::HTTP::ebug = $ebug;

#$^O =~ /mswin32/i and system("start http://localhost:$port/#top");
#$^O =~ /darwin/i and system("open http://localhost:$port/#top &");

Devel::ebug::HTTP->run($port);

1;
__END__

=head1 NAME

server - Catalyst Testserver

=head1 SYNOPSIS

server.pl [options]

 Options:
   -? -help    display this help and exits
   -p -port    port (defaults to 3000)

 See also:
   perldoc Catalyst::Manual
   perldoc Catalyst::Manual::Intro

=head1 DESCRIPTION

Run a Catalyst Testserver for this application.

=head1 AUTHOR

Sebastian Riedel, C<sri@oook.de>

=head1 COPYRIGHT

Copyright 2004 Sebastian Riedel. All rights reserved.

This library is free software. You can redistribute it and/or modify it under
the same terms as perl itself.

=cut
