Hi,
I'd like to automatically open the browser to a specific URL like my-project.com:3000, and not to localhost:3000.
I can't do it with tunnel option. Is it possible?
Hey! Sorry for necromancing this post, but does open work to open custom URLs as stated in the Command Line Documentation?
Choose which URL is auto-opened (local, external or tunnel), or provide a url
I've tried following command: browser-sync start --proxy "10.0.1.166:8080" --files "WebClients" --open "http://some-custom-url"
I have a similar question...
How do you specify an specic page when you init your Gulp project?
startPath seems to get mentioned in the docs, however it doesnt work for me:
gulp.task('browser-sync', >() {
browserSync.init({
server: {
baseDir: "./public",
startPath: 'index.html#test'
}
})
})
UPDATE: this seems to do the job:
browserSync.init({
server: {
baseDir: "./web",
middleware: [{
route: "/",
handle: > (req, res, next) {
res.writeHead(302, { 'Location': '/index.html#test' })
res.end()
next()
}
}]
}
})
@coderofsalvation The startPath is a sibling option of server, not a child
@dangelion This seems to work for me { "host": "my-project.com", "open": "external", "port": 3000 }
in the hopes of saving someone else some time later:
browserSync.init({
server: {
baseDir: '/baseDir/Path',
index: 'index.html',
},
startPath: `index.html?query=something`
});
@ctcpip
Such a joy to have someone actually comprehend _and_ answer a question. Thank you!
@ctcpip Thank you!
Just another example -
browserSync.init({
server: "./dist",
startPath: '/en/index.html',
});
Most helpful comment
in the hopes of saving someone else some time later: