How to write custom route and custom controller into strapi cms application?

Hey this is probably a silly suggestion. But did you ensure you rebuild/restarted the server.
You can test new routes without complex controllers. Simply hitting the controller would show you the route is working.

Given your custom routing routes, it may be worthwhile exploring this functionality to be a self-contained plugin, you’ll have access to everything you need inside a plugin.