sorry I realise I did not answer your question, it is a front end SPA, I pull all the urls from wordpress using:
add_action( ‘rest_api_init’, function () {
register_rest_route( ‘myplugin/v1’, ‘/author/(?P<id>\d+)’, array(
‘methods’ => ‘GET’,
‘callback’ => ‘my_awesome_func’,
) );
} );
(thats example above not actual code)