use of com.intellij.javascript.karma.KarmaConfig in project intellij-plugins by JetBrains.
the class KarmaServer method formatUrl.
@NotNull
private String formatUrl(@NotNull String path, boolean withUrlRoot) {
if (!path.startsWith("/")) {
path = "/" + path;
}
KarmaConfig config = myState.getKarmaConfig();
if (config != null) {
String baseUrl = "http://" + config.getHostname() + ":" + getServerPort();
String urlRoot = config.getUrlRoot();
if (!withUrlRoot || "/".equals(urlRoot)) {
return baseUrl + path;
}
return baseUrl + config.getUrlRoot() + path;
}
LOG.error("Karma config isn't ready yet.");
return "http://localhost:" + getServerPort() + path;
}
Aggregations