Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BrowserSync Cannot GET /

I only have installed NodeJS and BrowserSync with this command:

npm install -g browser-sync  

After I use this command to start the server:

C:\xampp\htdocs\browser_sync λ browser-sync start --server [BS] Access URLs:  --------------------------------------        Local: http://localhost:3000     External: http://192.168.1.223:3000  --------------------------------------           UI: http://localhost:3001  UI External: http://192.168.1.223:3001  -------------------------------------- [BS] Serving files from: ./ 

And I get the following error: Cannot GET /

I'm confused because I want to use BrowserSync with my Laravel project.

Where should I install BrowserSync?

Thanks.

like image 811
Funny Frontend Avatar asked Mar 10 '15 11:03

Funny Frontend


1 Answers

Using BrowserSync as a server only works if you're running a static site, so PHP won't work here.

Looks like you're using XAMPP to serve your site, you can use BrowserSync to proxy your localhost.

Example:

browser-sync start --proxy localhost/yoursite 

References:

  • http://www.browsersync.io/docs/command-line/#proxy-example
  • https://github.com/BrowserSync/browser-sync/issues/5
like image 106
Kyle Marimon Avatar answered Sep 28 '22 11:09

Kyle Marimon