[Dancer-users] rendering web page with HTML in a variable, no templates or layouts
Maxim Nikolenko
root at zbsd.ru
Fri Jun 24 12:46:05 CEST 2011
Hi!
You may return HTML-data from your route:
$ cat lib/test.pm
package test;
use Dancer ':syntax';
our $VERSION = '0.1';
get '/' => sub {
return "<html><body>Some data</body></html>\n";
};
true;
$ ./bin/app.pl --environment=production --daemon
>> Dancer 1.3051 server 17817 listening on http://0.0.0.0:3000
== Entering the production dance floor ...
$ telnet localhost 3000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Host: localhost
HTTP/1.0 200 OK
Content-Length: 35
Content-Type: text/html; charset=utf-8
X-Powered-By: Perl Dancer 1.3051
<html><body>Some data</body></html>
Connection closed by foreign host.
$
24.06.2011 14:32, Leandro Hermida ?????:
> Hi there,
>
> Sorry if I didn't find this in the docs, is there a way with Dancer to
> have it render a web page using HTML stored in a variable and not use
> any templating or layouts?
>
> thanks,
> Leandro
>
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Best regards,
Maxim Nikolenko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110624/8700f915/attachment.htm>
More information about the Dancer-users
mailing list