Closed JohnLukeBentley closed 7 years ago
I think I understand what you are sayng..I might need to have a project level setting so that when ever you open a different project the base url would be specific for that project...it has to be an enhancement..
What I'm suggesting in an enhancement, yes.
But the suggestion is to, by default, facilitate keeping the base url fixed, the value you enter in LocalHost Url
, as you switch between projects.
I'll use some more generic paths, and order the example, which might make things a bit clearer.
Imagine your Windows login name is "John" and you have a local path:
C:\Users\John\Documents\MyWebServerDocumentRoot\
In your Apache httpdf.conf (for example) you target this local path with
DocumentRoot "C:/Users/John/Documents/MyWebServerDocumentRoot"
And you have several different web projects stored underneath their own folder as follows
C:\Users\John\Documents\MyWebServerDocumentRoot\WebProject01
C:\Users\John\Documents\MyWebServerDocumentRoot\WebProject02
Assume those folders are also the folders you open, one at a time, in Atom with File > Open Folder ...
.
When serving these projects you'll want something like
http://localhost:8080/WebProject01/
http://localhost:8080/WebProject02/
And using open-in-browsers from Atom you want to build the path as (using WebProject01 as the example)
LocalHost Url: http://localhost:8080
plus
Project specific path, e.g.: /WebProject01/...
In other words, what you are doing right now, expect including the root folder that you open in Atom as part of the project specific path.
Now a further idea is to allow different base URLs on a project dependent basis. That's not part of my suggestion but it sounds like that's what you mistook my suggestion for. There is sometimes a need for this. E.g. Sometimes you might be using different local servers, different ports, http V https, etc; depending on the project...
https://localhost:6230
http://drupalcopy.localhost:8080
At the moment I have no need for this, so don't build it on my account. But it would round out your tool. At any rate, for me, the more important enhancement is making the baseURL project independent.
I happened to write some code for a different Atom plugin, to achieve what I am suggesting, at https://github.com/brycefranzen/local-server-web-view/issues/3 . With my modifications (not yet folded into the plugin but mentioned in the post) local-server-web-view affords both: project independent base urls; and project dependent base urls. But the limitation with local-server-web-view is that it operates on only one browser.
It's probably be easier to modify your existing code (I haven't looked at it), but by all means take whatever code of mine if saves any time.
check the latest patch..with the ability to add localhost
Feel free to reopen if still problems exist
Open-in-browsers generally works well if I have something like ...
... and if, in Atom, the root folder (File > Open Folder ...) is
web
(in my local file system atC:\Users\John\Documents\Sda\Code\web\
) and I'm loading a file... then the resulting path sent to browser works as desired:
However, if I open a different root folder in Atom. E.g.
C:\Users\John\Documents\Sda\Code\EcmaScript
then I'm forced to edit LocalHost Url to ...... in order to get
... to open as ...
My suggestion is for open-in-browsers to build the resulting path with the root folder included. That is, so that when I switch to a different folder in atom everything is handled without having to manually edit
LocalHost Url
.That is, in my case I'd like everything to work with: