Skip to content

Commit

Permalink
Revert "add support for additional hostnames" (#29)
Browse files Browse the repository at this point in the history
Revert "add support for additional hostnames (#28)"

This reverts commit f9331e4.
  • Loading branch information
tyler36 committed Nov 22, 2022
1 parent f9331e4 commit 45bf957
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ddev browsersync
```

The new `ddev browsersync` global command runs browsersync inside the web container and provides a
link ("External") to the browsersync-update URL. Use the URL in the output that says something like "External: <http://172.28.0.9:3000>".
link ("External") to the browsersync-update URL. Use the URL in the output that says something like "External: <http://d9.ddev.site:3000>".

## What does this add-on do and add?

Expand Down Expand Up @@ -83,12 +83,16 @@ Demo: <https://github.com/tyler36/browsersync-demo>
- Update `webpack.mix.js`

```js
// Use the HOSTNAME provided by DDEV
let url = process.env.DDEV_HOSTNAME;

mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css', [
//
])
.browserSync({
proxy: "localhost",
host: url,
open: false,
ui: false
});
Expand All @@ -103,11 +107,11 @@ ddev exec npm run watch
[Browsersync] Access URLs:
---------------------------------------------------
Local: http://localhost:3000
External: http://172.28.0.9:3000
External: http://browsersync-demo.ddev.site:3000
---------------------------------------------------
```

- Browsersync will be running at `https://172.28.0.9:3000`
- Browsersync will be running at `https://browsersync-demo.ddev.site:3000`

## TODO

Expand Down
4 changes: 3 additions & 1 deletion browser-sync.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// #ddev-generated
let docroot = process.env.DDEV_DOCROOT;
let filesdir = process.env.DDEV_FILES_DIR;
let url = process.env.DDEV_HOSTNAME;

if (filesdir === "") {
filesdir = null
Expand All @@ -15,5 +16,6 @@ module.exports = {
server: false,
proxy: {
target: "localhost"
}
},
host: url,
}

0 comments on commit 45bf957

Please sign in to comment.