Trigger BrowserSync reloads from url request?

Is there a way to trigger a full refresh of BrowserSync by requesting a URL?

The case for this would be some proxy web application with a database component. When something in the database was changed, the refresh hook could ping url to trigger a BrowserSync reload.

It seems like it should be possible by asking for some url on localhost:3001

, but I haven't found this kind of thing mentioned in the documentation.

+3


source to share


1 answer


Yes it is possible and fantastic.

BrowserSync 2.6.0 added support for HTTP endpoints, which is exactly what I was looking for: an HTTP request can trigger a reboot of all connected devices. Queries can originate locally or externally. The base reboot address looks like this:

http://localhost:3000/__browser_sync__?method=reload



Endpoints can also accept arguments for target files.

BrowserSync protocol protocols

0


source