Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gulp localhost Cannot GET /

First of all, I'm following Menno Pietersen's tutorial on Rapid MODx Workflow. I'm pretty positive I've followed it accurately, but for some reason when I do 'gulp watch' in my project folder I get a blank localhost:3000 page showing "Cannot GET /".

I'm not that familiar with all of the moving parts here, so I'm not sure where to even start as to why I'm getting this error instead of seeing my site. I've Googled it and come up with various other isses that don't seem related to my setup and/or tools used... and I've tried poking around myself and figuring it out, but I'm just spinning my wheels at this point.

Has anyone else tried this setup and encountered this? Or possibly have any idea where I should start?

I appreciate the help. I can give further information if need be. Thanks.

NOTE: If I put an index.html file in the project root then it displays that, but I'm not sure why it's not showing the modx site or how to fix it so it does.

UPDATE: I figured out that in my gulpfile.js, the gulp.task browser-sync was setup to use 'baseDir'.. I commented that out and used the proxy option and set it to 'localhost'. Fixed.

like image 457
Kevin Hamil Avatar asked Apr 03 '15 18:04

Kevin Hamil


2 Answers

Basic settings for BrowserSync include a built-in static server that works for basic HTML/JS/CSS websites (see documentation).

server: {
    baseDir: "app"
}

Remove that and use the proxy option. Like this:

// Using a vhost-based url
proxy: "local.dev"

Check docs for the full list of accepted url types

like image 57
Fred K Avatar answered Nov 04 '22 14:11

Fred K


I solve this issue

gulp.task('serve', function() {
    browserSync.init({
       proxy: "http://localhost/mydir"
    });
});
like image 27
danu Avatar answered Nov 04 '22 13:11

danu