Re: [Cppcms-users] CppCMS-Embedded web root
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@gm...> - 2016-02-11 08:10:59
|
> 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
|