Yaron 53 Posted June 15, 2019 Is there a way to shorten the URL required to access the MARS server? What I did so far was to modify FEngine.AddApplication('DefaultApp', '/v', [ 'Server.Resources.*']); in "Server.Ignition". Ideally, I would like to eliminate the "/rest" and application name entirely, so the entry point would be whatever I define in [Path('')]. Share this post Link to post
Andrea Magni 75 Posted June 16, 2019 12 hours ago, Yaron said: Is there a way to shorten the URL required to access the MARS server? What I did so far was to modify FEngine.AddApplication('DefaultApp', '/v', [ 'Server.Resources.*']); in "Server.Ignition". Ideally, I would like to eliminate the "/rest" and application name entirely, so the entry point would be whatever I define in [Path('')]. Hi @Yaron, you can definitely get rid of the "/rest" prefix by setting the Engine BasePath property to empty string (by default the engine has 'DefaultEngine' as Name and '/rest/ as BasePath): class constructor TServerEngine.CreateEngine; begin FEngine := TMARSEngine.Create; try // Engine configuration FEngine.BasePath := ''; // <============== FEngine.Parameters.LoadFromIniFile; // Application configuration FEngine.AddApplication('DefaultApp', '/default', [ 'Server.Resources.*']); If you want to push this thing futher, you can even think about inheriting your own TMARSActivation class and shortcut request matching by overriding FindMethodToInvoke method. HTH Sincerely, Andrea 1 Share this post Link to post