How to create REST API on a specific path (not /api/method/...)

Normal, I understand that we can create a whitelisted method which can appear as, i…e, https://server-name/api/method/myapp.do_something

I have a specific requirement, and I need the url, i…e, https://server-name/do_something

Is this even possible? Or any pointer to the sample code is good.

If nothing else, a frontend server redirect or mapping might help.

Routing/mapping in the Framework’s app server might also be possible.

Or maybe it’s possible to create a whitelisted method more or less at the root of the app tree.

To find it, I’d try to locate (with grep for an easy start) where the “api” method sits in the directory tree at “yourbenchspath/app/frappe”.

Then you could put your desired method next to it and redirect it wherever you want (meaning: calling any method which does what you want your endpoint to do).