64 |
|
|
65 |
eval { |
eval { |
66 |
|
|
67 |
#warn "REQUEST: $path ",dump( $req->params ); |
sub refresh { |
68 |
|
my $url = shift || '/'; |
69 |
|
warn "# refresh $url"; |
70 |
|
qq| |
71 |
|
<html> |
72 |
|
<head> |
73 |
|
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=$url"></META> |
74 |
|
</head> |
75 |
|
<body> |
76 |
|
Refresh <a href="$url"><tt>$url</tt></a> |
77 |
|
</body> |
78 |
|
</html> |
79 |
|
\n\r\n\r |
80 |
|
|; # XXX newlines at end are important to flush content to browser |
81 |
|
} |
82 |
|
|
83 |
if ( $path =~ m!reload! || $req->param('reload') ) { |
if ( $path =~ m{/reload(.*)} ) { |
|
warn "# reload!"; |
|
|
Module::Reload->check; |
|
84 |
Frey::Server->new->load_config; |
Frey::Server->new->load_config; |
85 |
|
Module::Reload->check; |
86 |
|
warn "# reload done"; |
87 |
|
$req->print( refresh( $1 ) ); |
88 |
|
return; |
89 |
|
} elsif ( $path =~ m{/exit(.*)} ) { |
90 |
|
# FIXME do we need some kind of check here for production? :-) |
91 |
|
# ./bin/dev.sh will restart us during development |
92 |
|
$req->print( refresh( $1 ) ); |
93 |
|
exit; |
94 |
} |
} |
95 |
|
|
96 |
# warn $req->request->header('User_Agent'); |
# warn $req->request->header('User_Agent'); |
146 |
} |
} |
147 |
|
|
148 |
if ( $f ) { |
if ( $f ) { |
149 |
|
push @{ $f->status }, { req => $req }; |
150 |
$req->print( $f->html ); |
$req->print( $f->html ); |
151 |
} else { |
} else { |
152 |
warn "# can't call request on nothing!"; |
warn "# can't call request on nothing!"; |