How to use Web Worker in Angular 6 - angular5

I want to use web worker in our project, can you give some examples of how to use web worker in angular 6 because I read some examples but it's not enough.
I try to using throw blob but I need to add some external script files in worker file and I stuck. importScripts function not working here.
If anyone have some reference please send me.

Related

ASP.NET Core 6 routing in Azure App Service with ".dd" ending in the url

I have an ASP.NET Core 6 Web API that has a simple endpoint
/resources/{id} where id is a string. Everything worked as expected in local development. We then deployed it to a standard Azure App Service.
We got a bug report when this particular URL was requested /resources/d.dd. The response was
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I have tried with these variations
resources/d.dd/
resources/d.vn (and other top-level domain name)
resources/hello.dd
resources/d.ddd
resources/d.txt
All worked except for d.dd without the last / in the URL.
I ran it locally. It worked. The d.dd was parsed and seen as the id.
It seems that .dd is routed as a file extension by the webserver on Azure. I spent hours looking around and checking Azure settings. I found nothing.
I am looking for a hint or suggestion. Thank you for your time and help.
UPDATE
We can create a web.config manually, and copy the content from azure and paste it.
Every time when you deploy it, it will include this web.config file.
Like:
Test Result

How do I create SQL connection to my app and Upload it to google cloud

Thanks for getting back at me. Sorry for the late reply, it was bed-time this time. I need to connect the Cloud SQL database that I have created to my application that is in App Engine. I tried to follow the online tutorials but when I do apply such info I would get then gcloud app deploy it return a connection error. Please help. Also clarify here: When I execute the gcloud app deploy command I suppose it takes my local file to Google Cloud where I would see the entire folder and files of my project on the project I was deploying but I am seeing the old version of my project while presentation has changed to the latest version. Also last one how can I link domain nam from http://domain.google.com to my app in http://cloud.google.com . Please help I am dying with stress I have been trying in here
Given that you haven't provided any information as to what settings you are using, or what error has been provided it is impossible to know what kind of problem you are running into.
I suggest taking a look at the "Connecting to App Engine" page here. It should answer a lot of your questions around connecting from an App Engine app.
I see two questions here.
1.
I need to connect the Cloud SQL database that I have created to my
application that is in App Engine. I tried to follow the online
tutorials but when I do apply such info I would get then gcloud app
deploy it return a connection error. Please help. Also clarify here:
When I execute the gcloud app deploy command I suppose it takes my
local file to Google Cloud where I would see the entire folder and
files of my project on the project I was deploying but I am seeing the
old version of my project while presentation has changed to the latest
version.
I see your problem here to be with CloudSQL and GAE connectivity. Depending on whether you use GAE Standard or Flex and CloudSQL MySQL or POSTGRES the steps varies. Documentation is quite clear in here though.
2.
Also last one how can I link domain nam from http://domain.google.com
to my app in http://cloud.google.com . Please help I am dying with
stress I have been trying in here
This is going to be super simple, goto GCP cloud console, Navigate to GAE-->Settings-->Custom Domain and click on add custom domain "Enter the domain name you want to link" When you click continue you will be shown the steps for verifying the domain owneship and to point the DNS to the GAE.
Documented properly by GCP folks at https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains
If you are using GAE Standard or Flex, a possible result of command gcloud app deploy :
An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine App, check next links:
https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
https://cloud.google.com/appengine/docs/flexible/python/writing-application-logs
Mysql and Postgres connection:
https://cloud.google.com/sql/docs/mysql/connect-app-engine
https://cloud.google.com/sql/docs/postgres/connect-app-engine
Sometimes it easy share the app.yaml for replicate the app correctly.

LocalResource not available after publishing mvc4 to azure

I've a very simple application built in MVC4. This application allow the users to upload a file, and the application generates an output.
This app works great locally, but when I publish to azure (by right click -> publish), I get a less descriptive error. I've figured out that the error was because in the code, we accessed to a server relative path, and that is not possible in azure. So I've found a way to solve that in this link, that says that I should use LocalResource, rather than Server.MapPath. That make sense for me, but so far, I'm struggling with the suggested line.
LocalResource localResource = RoleEnvironment.GetLocalResource("DownloadedTemplates");
I'm not able to get it working, and also can't get a proper error. BTW I'm not sure how to enable the error log in azure :(
So, after going deeper in MSDN, I've seen that I should configure the Local Storage Resources, but as I've created a local MVC4 project, I can't find where I should configure this.
I need to be able to store a temporary file in the application (hosted in azure).
Did someone faced with this problem?
Anybody knows how to enable the Local Storage Resource in a project like that?
TIA!
Milton Rodríguez
Well, after struggling a while, I've ended up using Windows Azure Tools.
The steps:
Add a new project
Under Cloud category, select Windows Azure Cloud Service.Note that if you don't have this option, an option to install the needed SDK will be shown. Install it first.
Name it properly :)
New Windows Azure Cloud Service window will appear, select the role that fits your needs. In my case, I choose ASP.Net MVC4, and then removed it.Note that you can edit the name of the created role at the right.
In the Roles folder of your new project, select Add, and then Web Role Project in solution. Your project will be an option to add.
You can remove the other role in the folder, the web project created in step 4, and also the folder ending in Content (ie. WebRole1Content). Basically, you can remove the created assets, but the Azure Service, and link the service to your project.
You're almost done. Follow this link to configurate your local storage :)
Now you're done!

How to use Twisted Web static.File resource without cache?

I am using the Twisted Web static.File resource for the static part of the web server.
For development I would like to be able to add new file or to modify the current static files without having the restart the Twisted web server.
I am looking at the source code for static.File at getChild method and I can not see how the resources are cached:
http://twistedmatrix.com/trac/browser/tags/releases/twisted-11.0.0/twisted/web/static.py#L280
From my understanding getChild method is returning a new resource at each call.
Any help in creating a non-cached static.File resource is much appreciated.
Many thanks,
Adi
twisted.web.static.File serves straight from the filesystem. It does not have a cache. Your web browser probably has a cache, though.

Help on Axis2 Deployment Exception

I am currently working on Axis2 deployed on Resin 3.1.3. However, I got the below error during deployment:
org.apache.axis2.deployment.DeploymentException: The "Dispatch" phase is not found on the global "InFlow" phase of the axis2.xml file. Make sure the phase is within the axis2.xml file.
Any idea how to resolve this? Thanks in advance for your valuable help.
-Angel
Have a look at this page, underneath the "Phase Order" heading. That should let you know how you need to define the Dispatch phase in your axis2.xml.
It's also possible that the axis2.xml file can't be found or is missing. You haven't provided many details so it's hard to be more specific than that.
Edit:
Remember that Axis2 is a standalone web application that is deployed into a servlet container.
You indicated in your comments that you modified your web application's web.xml. You should not need to do that to get Axis2 to work properly, so you can remove those mappings and redeploy your applications.
Try this guide. Make sure that you can see the "Axis2 Happiness" page described in step 6.
Once you have that working, you can go back to your other web applications and start modifying them to call your web services.