Where does one specify the path to a local web server?
I've spent hours trying different settings and googling for answers, but can't figure it out. I use a simple apache web server on my local machine to preview HTML pages, but can't get IDEA configured so that the browser preview feature goes to the right URL. The Open in Browser feature tries to open this URL:
http://localhost:63342/webperformance/load-testing-services/index.html?_ijt=ru54fiv710o5f37uivmuld6hbf
The actual path to the web server is:
http:///webperformance/load-testing-services/index.html?_ijt=ru54fiv710o5f37uivmuld6hbf
How the heck do I configure the project's webserver? I must have deleted and created a new project a dozen times now, but there doesn't seem to be any options to specify the web server.
Please sign in to leave a comment.
It has to be done in Settings (Preferences) | Build, Execution, Deployment | Deployment.
See https://confluence.jetbrains.com/display/PhpStorm/Deploying+PHP+applications+with+PhpStorm.
Note that you need to make your server default for your project to get its URL used for Open in Browser
First, what is PhpStorm? The product I'm using is IDEA.
Secondly, how does one set the server for a project? I can't find that setting anywhere in the project.
>First, what is PhpStorm? The product I'm using is IDEA.
it doesn't matter. Instructions are the same for all Idea-based products.
>Secondly, how does one set the server for a project? I can't find that setting anywhere in the project.
https://confluence.jetbrains.com/display/PhpStorm/Deploying+PHP+applications+with+PhpStorm#DeployingPHPapplicationswithPhpStorm-1.4.(optional)Setthedefaultserver
The "Use this server as default" button is grayed, out, but the default server seems to be working so I'm happy.
Thanks!
>The "Use this server as default" button is grayed
this indicates that the server is already marked as default:) You can press the rightmost button (with 'V' in it) to make it non-default
That answers all of my questions, thanks.
I am trying to test my Webstorm code ( angular) against a local server I am doing restful calls to. How can I tell webstorm the relative path for the server calls?
This code is not finding the right directory in my Jackson Rest service. It works okay in Eclipse, but the eclipse editor is not as good as Webstorm....
function getProducts() {
// cellA.progressOn();
dhx4.ajax.query({
method:"GET",
url:"../services/account/products",
data:"",
async:true,
callback:function(r){
if(r.xmlDoc.status == 200) {
productdetails = JSON.parse(r.xmlDoc.responseText);
var scope = angular.element(document.body).scope();
scope.productdetails = productdetails;
scope.$apply();
}
else {
dhtmlx.alert({
title:"Error Connecting to Server",
type:"alert-error",
text:"There was an error connecting to the server. Error: " + r.xmlDoc.statusText
});
}
>This code is not finding the right directory in my Jackson Rest service.
hmm... And how is it related to WebStorm? The code is run by the browser, not by the IDE. Normally relative URLs are resolved relative to current document/base URI (if specified)
When I launch the page at it's "raw" location here all is well:
http://localhost:8080/nimbus/pages/productwidget.html and the .. of my AJAX call gives me this address:
http://localhost:8080/nimbus/services/account/products
When I RUN the code from WEBSTORM it resolves to this URL:
http://localhost:63342/nimbus/WebContent/pages/productwidget.html?_ijt=iqciq3tsf1on8opbn1jisfa914 and the .. of my AJAX call gives me this address:
http://localhost:63342/nimbus/WebContent/services/account/products
IS there a way to RUN from WEBSTORM and get the correct URL?
Build-in web server serves files from http://localhost:63342/<project_name>, and path to resource there is normally http://localhost:63342/<project_name>/path/to/file/from/project/root.
You can 'skip' certain path by marking folder as resource root. For example, if your index.html is located in <project_root>/src/app, and you'd like it to be served as http://localhost:63342/<project_name>/index.html, you can mark app folder as Resource root