PapT
PapT

Reputation: 623

Gulp browsersync basedir

I'm working on localhost and I'm trying to use browsersync. I want to point it to my root directory, which is http://localhost:8080/site/

What should I write here:

server: {
    baseDir: ""
}

I tried ./ but didn't work.

It keeps redirecting me to http://localhost:3000/​ and getting this message: Cannot GET /

Here is my whole code:

browserSync.init({
        server: {
            baseDir: ""
        }
    });

Upvotes: 0

Views: 2296

Answers (1)

Danielle Klaasen
Danielle Klaasen

Reputation: 19

Using baseDir won't work in combination with PHP (takes only a static site)

Try proxy instead like the others suggested, and set a port.

Here's the code snippet:

browserSync.init({
        port: 8080,
        proxy: "http://localhost:8080/site/"
    });

Note that it's not under 'server' anymore, like the code in your question.

Upvotes: 1

Related Questions