Re: [Cppcms-users] CppCMS-Embedded web root
Brought to you by:
artyom-beilis
From: Rodrigo E. <rod...@gm...> - 2016-02-11 22:56:46
|
Hi Artyom, Thanks very much for your feedback. I tested the virtual main method and is executing properly. I changed the regex and the root url works very well. The problem now is that any other url just works if I add an extra "/" on the begin on the path. Thanks 2016-02-11 6:10 GMT-02:00 Artyom Beilis <art...@gm...>: > > class my_app : public cppcms::application{ > > public: > > my_app(cppcms::service& s) : cppcms::application(s){ > > dispatcher().assign("",&my_app::well_come,this); > > mapper().assign(""); > > mapper().root(""); > > } > > 1st check if cppcms::application::main is called (I think it should) > it is virtual > member function so you can override it. > > 2nd When you access to "localhost:8080" you get request GET / HTTP/1.0 > it is mapped according to the rules to > > /mb.fcgi/ > > Than /mb.fcgi is matched and the path you get is "/" > > When you map to "" you Require empty path and thus it does not get > dispatched. > > The correct is always to map to something starting with "/" or map to > "/?" i.e. last "/" is optional. > > > You can also use little bit different rule > > Instead of this > > { "regex" : ".*" , "pattern" : "/mb.fcgi$0" } > > Use > > { "regex" : "/(.*)" , "pattern" : "/mb.fcgi$1" } > > Than none of your urls will start from "/" > > it does not matter how do you do it - just pic and convention and stick to > it. > > Artyom > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |