adampresley/sublime-view-in-browser

Configure with local server not working

Opened this issue · 9 comments

This is my project config

{ "folders": [ { "path": "E:/xampp/htdocs/sivaprabug/Github/Backbonej-for-Beginners" } ], "settings": { "sublime-view-in-browser": { "baseUrl": "http://localhost", "basePath": "E:/xampp/htdocs/sivaprabug/Github/Backbonej-for-Beginners/001/index.html" } } }

My View In Browser.sublime-settings

`{
"posix": {
"linux": {
"firefox": "firefox -new-tab",
"chrome": "google-chrome",
"chrome64": "google-chrome",
"chromium": "chromium"
},
"linux2": {
"firefox": "firefox -new-tab",
"chrome": "google-chrome",
"chrome64": "google-chrome",
"chromium": "chromium"
},
"darwin": {
"firefox": "open -a "/Applications/Firefox.app"",
"safari": "open -a "/Applications/Safari.app"",
"chrome": "open -a "/Applications/Google Chrome.app"",
"chrome64": "open -a "/Applications/Google Chrome.app"",
"yandex": "open -a "/Applications/Yandex.app""
}
},
"nt": {
"win32": {
"firefox": "C:\Program Files (x86)\Mozilla Firefox\firefox.exe -new-tab",
"iexplore": "C:\Program Files\Internet Explorer\iexplore.exe",
"chrome": "%Local AppData%\Google\Chrome\Application\chrome.exe",
"chrome64": "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",
"yandex": "%Local AppData%\Yandex\YandexBrowser\browser.exe"
}
},

"browser": "chrome64",

}
`

Try taking the index.html and path off off. The basePath needs to be the base location of your files.

{
   "folders": [ 
      { "path": "E:/xampp/htdocs/sivaprabug/Github/Backbonej-for-Beginners" } 
   ], 
   "settings": { 
      "sublime-view-in-browser": { 
         "baseUrl": "http://localhost", 
         "basePath": "E:/xampp/htdocs/sivaprabug/Github/Backbonej-for-Beginners/001/index.html" 
      } 
   } 
}```

Hi @adampresley ,

Directly open file path only not with localhost [Server Configuration

directlyopenfilepath
]

Try

{
   "folders": [ 
      { "path": "E:/xampp/htdocs/sivaprabug/Github/Backbonej-for-Beginners" } 
   ], 
   "settings": { 
      "sublime-view-in-browser": { 
         "baseUrl": "http://localhost", 
         "basePath": "E:/xampp/htdocs/sivaprabug/Github/Backbonej-for-Beginners/001" 
      } 
   } 
}

This should open up the file index.php at http://localhost/index.php.

Hi @adampresley

Same window only opened..

file:///E:/xampp/htdocs/sivaprabug/Github/Backbonejs-for-Beginners/001/index.html

Can you paste your exact configuration here please? Also some details regarding your local PHP setup might help as well. Thanks

Same problem here. Same setup as above (but using firefox). Are you testing on a PC?

I have added the configuration file screen shots..
view in browser sublime-settings
backbonejs-lynda sublime-project

same problem here in my home pc.
But its working fine in my office pc.
Maybe its related to sublime version.