MEF: How to send message from module to host application - wpf

I've got next problem. I have a 3 modules and a host application. How to send an event with params (or command with params) from modules and hadle it in host application or in another module?

Related

After deploy my react app returns an error that cannot load a js file

I have an json file in the public folder, to which after starting the application I make a request to it. When I load the application from a port on which I hosted it, everything is fine, but when I change the port with some url (test.project.bg) this json file does not build or somehow does not find the way to it.

Running two Angular apps simultaneously

I'm working on an application, and want to extend/expand it with another (new) Angular application. The goal is to eventually replace the old one by the new one, but for now, it should just be accessible by going to /v2, and serve as a pilot.
The setup is as follows:
NodeJS backend: port 11020
Angular/AngularJS-hybrid app: port 11000
Angular-app: port 4200 (this is the new application)
I want to be able to access the new application by going to my-app.com/v2.
I have created a proxy.conf.json file for the main application:
{
...
"/v2": {
"target": "http://localhost:4200/",
"secure": false
}
}
I think it works, because when I go to the /v2 route, it indeed forwards me to the new application, and when using 'Inspect Element' I see the new index.html's head, body and page title. Ok, great.
But.. it never loads the application any further, and throws the following error:
app.ts:8 Uncaught ReferenceError: angular is not defined
at app.ts:8
at Object.iN1H (app.ts:39)
at __webpack_require__ (bootstrap:79)
...
The error is thrown both locally using webpack-server, and after building/serving from our server.
The error points to the original (hybrid) application, where angular is used to reference angularjs.
Why is the new application crashing because of references in/to the old application?

modifying dotnetify react js to use in cordova application (change path of dotnetify.react.connect)

I am using React app that wraps DotNetify around Cordova to build iOS and Android app.
Dotnetify connects to a WebSocket Server at given URL, we need to define based on build web or Cordova what is the host URL to connect to the Socket/SignalR server, current line is:
dotnetify.react.connect('Login', this);
the definition of Login is actually relative and I need to pre-pend the host URL somehow to tell build where is the WebSocket to connect to.
My assumption is it should be defined somewhere in Package.json to make it look like below:
dotnetify.react.connect('WSS://DEV.DOMAIN.COM/'+'Login', this);
What's the best solution to address this issue for development/debug mode locally or development on a server with public static IP or production server.
I have found base_url that needs to be passed in info object: node_modules/socksjs-client/lib/main.js:183
// allow server to override url used for the actual transport
this._transUrl = info.base_url ? info.base_url : this.url;
So based on above I tried to pass argument, but donetify is not passing this argument to the socksjs. how do we fix this actually?
this.vm = dotnetify.react.connect('Login', this, {"base_url":"wss://dev.domain.com"});
You can use below to set below in your index.js to set the host right before connecting line.
dotnetify.hubServerUrl = 'domain.example.com';

Cannot access Node.js API in my Angular app due to WebStorm's built-in server port mismatch

I am trying to follow the tutorial on creating a MEAN app on scotch.io.
I am using the WebStorm IDE and after completely following through I am stuck with a problem that seems to emerge from WebStorm. If I click on the "Open in Chrome"-Button in the IDE I am referred to:
localhost:63342/scotch_mean_tutorial/views/index.html
However, the actual port that I specified in my server.js is 8080 file:
// listen (start app with node server.js) ======================
app.listen(8080);
console.log("App listening on port 8080");
I have built a node API and it works when I go to:
http://localhost:8080/api/todos
However, clicking on the "Open in Chrome" through my WebStorm IDE uses a different port (i.e. 63342) and thus I am left with the following error:
GET http://localhost:63342/api/todos 404 (Not Found)
I am not sure how to resolve this? Any ideas?
You need to create a javascript debug run configuration with the correct URL (http://localhost:8080/api/todos) and use this configuration to open your URL in browser. Another option: specify this URL in Live Edit/Browser tab of node.js run configuration you use to run your server.js and tick 'after launch' checkbox to automatically start the browser with this URL on server start.
In Webstorm 9, you can configure the port for debugging apps. In Preferences:
Build, Execution, Deployment > Debugger > Built-in Server Port

How do I execute App Engine Go SDK delay package on a different module?

I have an app with several modules. A dispatch.yaml file routes all */api/* calls from my default module to my server module.
The following request chain happens:
http://myapp.appspot.com/api/webrequest - Note we are on the default module.
http://server-dot-myapp.appspot.com/api/webrequest - Redirection with dispatch.yaml to the server module where appengine.delay.Call is made using the delay package.
http://myapp.appspot.com/_ah/queue/go/delay - The appengine.delay.Func is called on the default module instead of http://server-dot-myapp.appspot.com/_ah/queue/go/delay like I would expect.
How can I make my appengine.delay.Func execute with http://server-dot-myapp.appspot.com/_ah/queue/go/delay?
Note that if I call http://server-dot-myapp.appspot.com/api/webrequest directly without using the dispatch.yaml redirect, everything workes as expected and appengine.delay.Func gets called with http://server-dot-myapp.appspot.com/_ah/queue/go/delay.
This is due to an incongruity in App Engine. See Google Groups discussion for further information.
Essentially instead of using appengine.delay.Call you use appengine.delay.Task and set the Host param to the module host name you want:
t := myDelayFunc.Task("myparam")
t.Header = make(map[string][]string)
hostName, err := appengine.ModuleHostname(context, "[your module name]", "", "")
t.Header.Set("Host", hostName)
taskqueue.Add(context, t)

Resources