Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

Override base path #691

Open camlafit opened 1 year ago

camlafit commented 1 year ago

Hello

I use a library to manage all application route (in my case https://github.com/nikic/FastRoute) I've configured my index to load restler part from a specific path. (https://domain.tl/api/)

In this case Restler can't run correctly as a Restler::getPath() exploit $_SERVER['SCRIPT_NAME'] to detect base path. In this case base is set to / and not /api/

Could be nice to provide a configuration/default value to override this base. Maybe I've missed an option to manage this use case.

I've tried with V5