}
my $json_routes = $c->render_to_string( json => \%names2paths );
utf8::decode( $json_routes );
my $js = <<"JS";
var mojolicious_routes = $json_routes;
function
# In your layout template
<head>
<%= js_url_for%>
</head>
# In your javascript
$.getJSON( url_for( 'messages_show', {message_id: 123} ), params, function() { ... } )
# Instead of hel