[Cppcms-users] Is it possible to include json-rpc application with other applications?
Brought to you by:
artyom-beilis
|
From: Abhishek K. <abh...@gm...> - 2014-07-17 17:15:23
|
Hello Artyom, CPPCMS Developers,
I have a main function defined as follows:
int main(int argc,char **argv)
{
try {
cppcms::service srv(argc,argv);
srv.applications_pool()
.mount(cppcms::applications_factory<app_common::Main_controller>());
srv.applications_pool()
.mount(cppcms::applications_factory<app_user::User_json_service>());
srv.run();
}
catch(std::exception const &e) {
std::cerr << "Failed: " << e.what() << std::endl;
std::cerr << booster::trace(e) << std::endl;
return 1;
}
return 0;
}
app_common::Main_controller : is the normal application, which contains url
dispatcher bound to their relevant methods.
app_user::User_json_service : is an RPC application.
However, when I run the method, I see that app_common::Main_controller works
as usual, however, I don't see app_user::User_json_service responding to any
url calls.
In config.js, I have added
"http" : {
"script_names" : ["/lb","/rpc"] ,
"rewrite" : [
{ "regex" : "/media(/.*)?", "pattern" : "$0" },
{ "regex" : "/rpc(/.*)?", "pattern" : "/rpc$0" },
{ "regex" : ".*" , "pattern" : "/lb$0" }
But the RPC never works here. Can you tell me a proper way to do it? is it
possible to added multiple application in the pool and get working? Or do I
require have a different server dedicated for doing RPC work only?
Please let me know.
Regards,
Abhishek
|