Backend - is the code that runs on server.
Frontend - is the code that runs on the browser on client machine.
Routers can work only residing in routers.js file under the backend section.
User-Agent is a header which is sent from the browser to the server (backend) on each request.
Can you please describe the functionality you are trying to achieve?
Regards,
Genry.