/** * @Route("/exchange/{file}.{_format}", defaults={"_format"="json"}, name="exchange") * @Method({"GET"}) * * @param string $file * @return void * @author Fran Iglesias */ public function exchangeAction($file) { $file = $this->get('kernel')->getRootDir() . '/../var/exchange/' . $file . '.json'; $response = new BinaryFileResponse($file); $response->setTtl(0); $response->headers->set('Content-Type', 'application/json'); return $response; }