An open API service indexing awesome lists of open source software.

https://github.com/victor141516/livereload

Golang liveReload for frontend development. Usage: ./liveReload [path] [port]
https://github.com/victor141516/livereload

Last synced: 2 months ago
JSON representation

Golang liveReload for frontend development. Usage: ./liveReload [path] [port]

Awesome Lists containing this project

README

        

# liveReload
Golang liveReload for frontend development. Usage: ./liveReload [path] [port]

## Frontend code
```
// liveReload poller begin
const poller = setInterval(() => {
fetch('http://127.0.0.1:15555', {mode: 'cors'}).then(res => res.text().then(text => {
if (text === '1') {
location.reload();
}
})).catch(() => {
console.log('liveReload not detected, poller stopped.');clearInterval(poller); // eslint-disable-line
});
}, 1000);
// liveReload poller end
```