public function routesAction(Request $request)
    {
        $routeExtractor = $this->get('phlexible_gui.route_extractor');
        $extractedRoutes = $routeExtractor->extract($request);

        $content = sprintf('Phlexible.Router.setData(%s);', json_encode(array(
            'baseUrl' => $extractedRoutes->getBaseUrl(),
            'basePath' => $extractedRoutes->getBasePath(),
            'routes' => $extractedRoutes->getRoutes(),
        )));

        return new Response($content, 200, ['Content-type' => 'text/javascript; charset=utf-8']);
    }