ngx-translate access json file in different port - angular5

I am using ngx-translate for translating content in my angular app. But this is running in different port ( for example: 8090). I have done setup referring translatehttploader by referring https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-angular-app-with-ngx-translate
once I build and serve the app, it is throwing error as the json file not found ( Error 404).
The url it displays as
http://localhost/assets/i18n/en.json
if I add the port in the url (i.e.)
http:8090//localhost/assets/i18n/en.json
I am able to see the json content in browser. What I infer that it is referring default port 80. But it should refer the port 8090. So Can some one help me where I should configure the port to read json file by app to make translatehttploader serve from it?

Related

Laravel Dusk: The correct localhost port for APP_URL on a remote server?

I am trying to install Dusk on Laravel at a REMOTE host and at some point I need to change the .env file like this
APP_URL=http://localhost:8000
Another tutorial suggested something like
APP_URL=http://localhost:9515
For a remote host, do I need to put "http://localhost:????" and if I need how do I find the port number? I not do I just leave it as "/"?
By the way, I have tested several options and non have worked so far so but I am not sure what causes it so I am trying to pint point the problem.
Set the APP_URL to the same URL you are using in the browser for your local development environment. This can be http://localhost but also a custom URL:
APP_URL=http://dusk.local
For Laravel Homestead you can manage your sites within your Homestead.yaml file.
The APP_URL is somehow important as commands from the terminal require this information as pointed out in detail in this answer.
The port 9515 is the default port number of the Selenium server URL as provided in DuskTestCase.php. There's no need to change it at the beginning as it should work out of the box.
By default, the ports are forwarded to your Homestead environment.

How to default HTTP request to servername followed by path in JMeter

I'm new to JMeter and am having trouble figuring out how to get my default URL to be what I want it to be. Right now, I've added an HTTP Request Defaultsconfig element to my test plan. In the Web Server box I have a url of the following format:
testproject.company.com
What I actually want the default URL to be is
testproject.company.com/test
The first thing I tried was setting the Server Name or IP to testproject.company.com/test, but this gave me an error
java.net.UnknownHostException: testproject.company.com/test
Next, I set Server Name or IP back to testproject.company.com and filled in the Path box in the HTTP Request section with
/test
This does not cause any errors, but all of my tests fail because it is simply using testproject.company.com as the default URL.
I am also using a Project Files config, and within the Configure the CSV Data Source section, in the Filename box, have the path to a .csv file. The .csv file has the following contents:
testproject.company.com/test/,username#testproject.train,10,true,WIN
What's preventing JMeter from adding /test to the default URL?
I believe the issue is due to a misunderstanding of the Path field under the HTTP Request Defaults section. It appears that the path in that section will only be used for tests where a path is not defined. So instead of adding the path from the test to the default path, it simply replaces it. Because of this, you have to manually add the path to each test that specifies a path.
If anyone knows of a better way to do this, let me know!
Use userdefined variables
Declare the "/test" as PATHVARIABLE in a user defined variable.
In each request append the variable to the path
${PATHVARIABLE}/yourUrl
Add "HTTP Sampler" under Thread group. In HTTP Request Defaults define Server IP as testproject.company.com and in HTTP Sampler define "/test" as Path.Leave the Server Name or IP field blank.
Thanks
The first thing I tried was setting the Server Name or IP to
testproject.company.com/test, but this gave me an error
java.net.UnknownHostException: testproject.company.com/test
It appears that this error is given depending on which "implementation" you are using for the HTTP Request sampler.
Setting the implementation to anything other than 'Java' (e.g. HttpClient4) solved this problem for me.

How to run Apache Flume on http source including path url?

I am running an Apache Flume http source on localhost and binding it to a port, as described in the documentation:
agent.sources.httpSource.type = http
...
agent.sources.httpSource.port = 80
Now my source is listening on http://<ip>:80. How can I modify it so it could run with a path in the url? like so: http://<ip>:80/example_path?
I didn't find anything in the documentation and in the web concerning this issue.
have you tried to simply sent the data to http://<ip>:80/example_path? As far as a I know, it should work, independently of the path within the URL. A very different thing is if you want to implement a specific behaviour depending on the path. In that case, you will have to create a custom handler for the HTTPSource source by extending HTTPSourceHandler.

Intellij idea opens static pages in browser with different url formats

Intellij idea has a nice "open in browser feature" that I use quite often for my static html files. Any html file can be opened in browser in two ways: 1. Idea has an internal web server that serves static content at http://localhost:63342/<relative path to content> . 2. Via file:///<absolute path> url.
After a recent update (14.0.2) the browser started to open pages as file:///<absolute path> although the internal web server is still present and all I need to do is edit the url. Very annoying. I searched a lot but still can't figure out how can I influence this behaviour so all my static pages would open in browser as http://localhost:63342/<relative path to content>
Specify the server connection settings:
In the Host text box, type localhost.
Use the Port spin box to specify the number of the port where the built-in web server runs. The port number should be set to 1024 or higher. By default this port is set to the default IntelliJ IDEA port through which IntelliJ IDEA accepts connections from services (63342).
Specify the folder that will be considered server document root. The folders that are under this document root in the project tree will be submitted to the PHP interpreter. The server document root folder will be accessed through HTTP at the above specified host:port.
In the Document root text box, specify the path to the relevant folder. This can be the project root or any other folder under it.
References
Idea Docs: Built-in Web Server

Need to access remote files from Apache server

I am new to Apache.
I am running apache tomcat in windows and using JSP as the server side language.
I have a page containing links to the files (different machine) as below:
TheButterflyEffec(2004).avi
Superbad.avi
Why OnClick, saveAs is not working?
It is working if i save the page locally.
Do I need to configure anything in server.xml?
If the files are loaded on the machine running the apache then you need to look of two thinghs...
Put the files in a directory inside the apache root directory
In the <a href specify the file location with the ip address of it
(i.e. if your apache is on a machine with IP 192.XXX.XXX.XX then give the a href as follows
<
a
href='http://192.XXX.XXX.XX/folderWherefilesare/filename'>
filename < / a>
It's not working because the browser look for those files on the local visitor machine, not on the server.
You have to build "proxy" code with server side language like PHP that will get file name as parameter, e.g. Download.php?file=TheButterflyEffec(2004).avi then read the file from the server disk and send the file contents to the browser.
If you're using PHP indeed, here is an article describing what you can do:
http://www.boutell.com/newfaq/creating/forcedownload.html
Otherwise let us know what server side language you can use and retag your question according to this.