title: My first controller in symfony
body: <pre><code>// src/AppBundle/Controller/LuckyController.php
  namespace AppBundle\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Component\HttpFoundation\Response;
  
  class LuckyController extends Controller
  {
      /**
       * @Route("/lucky/number")
       */
      public function numberAction()
      {
          $number = rand(0, 100);
  
          return new Response(
              '&lt;html&gt;&lt;body&gt;Lucky number: '.$number.'&lt;/body&gt;&lt;/html&gt;'
          );
      }
  }
  </code></pre>
  
  <p>I'm new of Symfony framework. I tried this simple code without any result. 
  That's the server response:</p>
  
  <blockquote>
    <p>No route found for "GET /lucky/number" 404 Not Found - NotFoundHttpException
    1 linked Exception: ResourceNotFoundException »</p>
  </blockquote>
  
  <p>I don't now why the Default controller use the annotation and I can see the homepage of my Symfony application.</p>