<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sukria.net &#187; Sinatra</title>
	<atom:link href="http://www.sukria.net/fr/archives/tag/sinatra/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sukria.net/fr</link>
	<description>I will press many keys on my keyboard causing an implementation to occur.</description>
	<lastBuildDate>Wed, 18 Jan 2012 17:11:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Teaser&#8230;</title>
		<link>http://www.sukria.net/fr/archives/2009/07/17/teaser/</link>
		<comments>http://www.sukria.net/fr/archives/2009/07/17/teaser/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 17:39:52 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Sinatra]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1152</guid>
		<description><![CDATA[Je suis tombé récemment sur Sinatra, sûrement grâce au blog de oz ou à celui de sa société, j&#8217;ai trouvé l&#8217;idée amusante, et même plutôt brillante. Bon on ne se refait pas, je dois avoir chopé une sorte de maladie qui fait que j&#8217;aime réécrire des trucs en Perl, ça commence à devenir inquiétant diront &#8230; <a href="http://www.sukria.net/fr/archives/2009/07/17/teaser/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Je suis tombé récemment sur <a href="http://www.sinatrarb.com/">Sinatra</a>, sûrement grâce <a href="http://wtf.cyprio.net/">au blog de oz</a> ou à <a href="http://dev.af83.com/">celui de sa société</a>, j&#8217;ai trouvé l&#8217;idée amusante, et même plutôt brillante.</p>
<p>Bon on ne se refait pas, je dois avoir chopé une sorte de maladie qui fait que j&#8217;aime réécrire des trucs en Perl, ça commence à devenir inquiétant diront certains, probablement, mais tant que ça m&#8217;amuse je ne vois pas pourquoi arrêter.</p>
<p>Bon venons-en au fait, j&#8217;ai un script <code>bin/mawebapp.pl</code> :</p>
<pre class="prettyprint">
#!/usr/bin/perl

use Dancer;

get '/' => sub {
    "Hello There!"
};

get '/hello/:name' => sub {
    my $params = shift;

    "Hey ".$params->{name}.", how are you?";
};

Dancer->dance;
</pre>
<p>Je lance cet objet numérique étrange &#8230;</p>
<pre class="prettyprint">
$ perl bin/mawebapp.pl
== Entering the dance floor ...
>> Listening on 0.0.0.0:8080
</pre>
<p>&#8230; Puis je joue avec </p>
<pre class="prettyprint">
$ curl http://localhost:8080/
Hello There!

$ curl http://localhost:8080/hello/YouFreak
Hey YouFreak, how are you?
</pre>
<p>Merci oz ! </p>
<p><del datetime="2009-07-18T09:32:52+00:00">Bientôt disponible sur github pour ceux qui veulent jouer avec moi</del> <a href="http://github.com/sukria/Dancer/tree/master">c&#8217;est ici</a>.</p>
<p><b>UPDATE 23 Juillet</b></p>
<p>Quelques corrections dans ce billet sur les exemple de code, pour un détail plus complet sur ce framework, je vous invite à lire le <a href="http://github.com/sukria/Dancer/blob/fff4b76ce080877ab80ccec727b504306c5d4ba0/README">README</a> ou à regarder <a href="http://github.com/sukria/Dancer/tree/fff4b76ce080877ab80ccec727b504306c5d4ba0/example">l&#8217;application d&#8217;exemple</a> fournie avec le source.</p>
<div id='teoShare' ><div id='teo2Google'>
		<!-- Place this tag where you want the +1 button to render -->
		<g:plusone size='tall' annotation='none'></g:plusone>

		<!-- Place this render call where appropriate -->
		<script type='text/javascript'>
		  (function() {
			var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
			po.src = 'https://apis.google.com/js/plusone.js';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
		  })();
		</script>
		</div><div id="teoTweet" >
		<a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="sukria">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </div></div><div style="height:0px; width:0px; overflow:hidden;"><a href="http://www.zeitblog.com/?in=plugin">blog tools and plugins from www.zeitblog.com</a></div><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2009/07/17/teaser/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

