[Cppcms-users] RES: RES: URL maps
Brought to you by:
artyom-beilis
|
From: Renato F. <re....@ay...> - 2011-03-25 15:57:21
|
Thanks for help,
How config file should be to work?
This is what I have:
{
"vws" : {
"media" : "/media",
"root" : "/vws",
"host" : "localhost:8080",
"connection-string-dir" : "E:\\project.vgsws\\resources\\connection-strings"
},
"service" : {
"api" : "http",
"port" : 8080,
"worker_threads" : 20,
},
"http" : {
"script" : "/",
"script_names" : [ "/test", "/portal" ]
},
"file_server" : {
"enable" : true
},
"session" : {
"expire" : "renew",
"timeout" : 604800,
"location" : "client",
"client" : {
"encryptor" : "hmac",
"key" : "232074faa0fd37de20858bf8cd0a7d04"
}
},
}
And in class:
class App : public cppcms::application
{
public:
Test _test;
Portal _portal;
App(cppcms::service &s)
: cppcms::application(s)
, _test(s)
, _portal(s)
{
add(_test, "/test", 1);
add(_portal, "/portal", 1);
}
};
Thank you very much, for help.
-----Mensagem original-----
De: Cristian Oneț [mailto:one...@gm...]
Enviada em: sexta-feira, 25 de março de 2011 12:29
Para: cpp...@li...
Assunto: Re: [Cppcms-users] RES: URL maps
It does not work because you application is mounted at '/' and your sub-applications at '/test' and '/home' and that's relative to your parent application's mountpoint. So after '/' is matched for your main application you will only have 'test' (not '/test') or 'home' (not
'/home') left from the url to match and it will not match.
On Fri, Mar 25, 2011 at 4:57 PM, Renato Forti <re....@ay...> wrote:
> Like this:
>
> "http" : {
> "script_names" : [ "/test", "/ home " ]
> },
>
> :o(, I did try, but don't work...
>
> Any tip?
>
> Thanks, thanks, thanks...
>
> -----Mensagem original-----
> De: Cristian Oneț [mailto:one...@gm...] Enviada em:
> sexta-feira, 25 de março de 2011 11:53
> Para: cpp...@li...
> Assunto: Re: [Cppcms-users] URL maps
>
> I think that your problem is that "/test" and "/home" are missing from the scripts section of the configuration file.
>
> On Fri, Mar 25, 2011 at 3:15 PM, Renato Forti <re....@ay...> wrote:
>> Hi,
>>
>>
>>
>> I am try understand how group and map url.
>>
>>
>>
>> For sample I have 2 classes:
>>
>>
>>
>> class Home : public cppcms::application
>>
>> class Test : public cppcms::application
>>
>>
>>
>> And a class that I can group apps:
>>
>>
>>
>> class App : public cppcms::application
>>
>> {
>>
>> public:
>>
>>
>>
>> Home _home;
>>
>> Test _test;
>>
>>
>>
>> App(cppcms::service &s)
>>
>> : cppcms::application(s)
>>
>> , _home(s)
>>
>> , _test(s)
>>
>> {
>>
>> add(_test, "/test", 1);
>>
>> add(_home, "/home", 2);
>>
>> }
>>
>> };
>>
>>
>>
>>
>>
>>
>>
>> int main(int argc,char ** argv)
>>
>> {
>>
>> try
>>
>> {
>>
>> cppcms::service srv(argc, argv);
>>
>> srv.applications_pool().mount(cppcms::applications_factory<App>());
>>
>> srv.run();
>>
>> }
>>
>> catch(std::exception const &e)
>>
>> {
>>
>> std::cerr<<e.what()<<std::endl;
>>
>> }
>>
>> }
>>
>>
>>
>> But when I’d tried access like:
>>
>>
>>
>> http://localhost:8080/test
>>
>> or
>>
>> http://localhost:8080/home
>>
>>
>>
>> Don’t work, What is wrong?
>>
>>
>>
>> My config file:
>>
>>
>>
>> {
>>
>>
>>
>> "service" : {
>>
>> "api" : "http",
>>
>> "port" : 8080,
>>
>> "worker_threads" : 20,
>>
>>
>>
>> },
>>
>> "http" : {
>>
>> "script" : "/"
>>
>> },
>>
>> "file_server" : {
>>
>> "enable" : true
>>
>> },
>>
>> "session" : {
>>
>> "expire" : "renew",
>>
>> "timeout" : 604800,
>>
>> "location" : "client",
>>
>> "client" : {
>>
>> "encryptor" : "hmac",
>>
>> "key" :
>> "232074faa0fd37de20858bf8cd0a7d04"
>>
>> }
>>
>> },
>>
>> }
>>
>>
>>
>> Thaks
>>
>> ---------------------------------------------------------------------
>> -
>> -------- Enable your software for Intel(R) Active Management
>> Technology to meet the growing manageability and security demands of
>> your customers. Businesses are taking advantage of Intel(R) vPro (TM)
>> technology - will your software be a part of the solution? Download
>> the Intel(R) Manageability Checker today!
>> http://p.sf.net/sfu/intel-dev2devmar
>> _______________________________________________
>> Cppcms-users mailing list
>> Cpp...@li...
>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
>>
> ----------------------------------------------------------------------
> -------- Enable your software for Intel(R) Active Management
> Technology to meet the growing manageability and security demands of
> your customers. Businesses are taking advantage of Intel(R) vPro (TM)
> technology - will your software be a part of the solution? Download
> the Intel(R) Manageability Checker today!
> http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
> ----------------------------------------------------------------------
> -------- Enable your software for Intel(R) Active Management
> Technology to meet the growing manageability and security demands of
> your customers. Businesses are taking advantage of Intel(R) vPro (TM)
> technology - will your software be a part of the solution? Download
> the Intel(R) Manageability Checker today!
> http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Cppcms-users mailing list
Cpp...@li...
https://lists.sourceforge.net/lists/listinfo/cppcms-users
|