Browser-sync: Cannot GET/

Created on 30 Jun 2015  路  7Comments  路  Source: BrowserSync/browser-sync

Hey there!

linux@linux-desktop:~/Templates/browsersync-project$ ls 
brow.html  css
linux@linux-desktop:~/Templates/browsersync-project$ browser-sync start --server --files="css/*.css"
[BS] Access URLs:
 ------------------------------------
       Local: http://localhost:3000
    External: http://192.168.1.2:3000
 ------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.1.2:3001
 ------------------------------------
[BS] Serving files from: ./
[BS] Watching files...

In browser (Firefox http://localhost:3000/) I see only : Cannot GET/
any suggestions?

Most helpful comment

@dagolinuxoid it looks for an index.html file in the directory you specify (or the cwd, if you didn't)

solutions:

  1. either use an index.html
  2. use the index option like so
browser-sync start --server --index bower.html --files="css/*.css"

All 7 comments

Interesting! When I rename bower.html to index.html I had no troubles, but why custom naming html file (in my case bower.html) get Cannot GET )

@dagolinuxoid I guess is because it looks for index as a normal server would? try with startPath example in gulpfile:

gulp.task('browser-sync', function() {
  browserSync({
    server: {
      baseDir: "./"
    },
    startPath: "/html"
  });
});

@dagolinuxoid it looks for an index.html file in the directory you specify (or the cwd, if you didn't)

solutions:

  1. either use an index.html
  2. use the index option like so
browser-sync start --server --index bower.html --files="css/*.css"

Got it, thanks a lot!

Thanks, i solve it follow your answer

Thanks!

Thanks guys

Was this page helpful?
0 / 5 - 0 ratings