Browser-sync: Is there a way to mount the application in a sub path?

Created on 8 Oct 2016  路  3Comments  路  Source: BrowserSync/browser-sync

I can't find a way to specify a path at which to serve the app at. Instead of http://localhost:9000 I need it served at http://localhost:9000/something, because I'm using a reverse proxy on a shared server.

I found a relevant stackoverflow question here from a year ago without an accepted answer: http://stackoverflow.com/questions/30370753/gulp-browsersync-serve-at-path

Is this possible by now?

Most helpful comment

This is totally possible by configuring the server options with a route. Basically this:

    server: {
      baseDir: '-',
      routes: {
        '/arbitrary/subpath': '.'
      }
    }

I answered the Stack Overflow question @kraf linked with more detail: http://stackoverflow.com/a/41494102/503463

Here's a complete functional Gist: https://gist.github.com/joemaller/0254b34b88cfc6a9a665025c722891b5

All 3 comments

+1

This is totally possible by configuring the server options with a route. Basically this:

    server: {
      baseDir: '-',
      routes: {
        '/arbitrary/subpath': '.'
      }
    }

I answered the Stack Overflow question @kraf linked with more detail: http://stackoverflow.com/a/41494102/503463

Here's a complete functional Gist: https://gist.github.com/joemaller/0254b34b88cfc6a9a665025c722891b5

thanks @joemaller - care to contribute an example ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ilianaza picture ilianaza  路  4Comments

arve0 picture arve0  路  4Comments

adjavaherian picture adjavaherian  路  4Comments

sedubois picture sedubois  路  3Comments

demisx picture demisx  路  4Comments