https://github.com/erdembircan/source-reload
automatic client side reload to reflect server side changes
https://github.com/erdembircan/source-reload
Last synced: 5 months ago
JSON representation
automatic client side reload to reflect server side changes
- Host: GitHub
- URL: https://github.com/erdembircan/source-reload
- Owner: erdembircan
- License: mit
- Created: 2019-03-04T20:03:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-01T18:32:06.000Z (over 6 years ago)
- Last Synced: 2024-04-26T16:45:59.579Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 112 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔄 source-reload [](https://travis-ci.com/erdembircan/source-reload) [](https://coveralls.io/github/erdembircan/source-reload?branch=master)
> client side browser reloader for server side changes## Why
Sometimes you may want to reflect the changes on your server/api endpoints to your front-end development. This package gives you the ability to reload your connected frontend browser on server side changes. It's change detection agnostic (whether you use node.js `watch` or wonderful `nodemon` package).## Usage
Please checkout out the `example` folder for sample usage.
```bash
# start example server
npm run example:server
```## API
### source-reload
main object consists of a middleware and frontend client
- **type**: `object`
- **props**:
- `SourceReloadMiddleware`: A middleware for Node.js server
- **type**: `function`
- **arguments**:
- `req`: request object
- **type**: `object`
- `res`: response object
- **type**: `object`
- `SourceReloadClient`: Frontend client
- **type**: `function`
- **arguments**:
- `url`: url adress for backend stream connection
- **type**: `string`## Contribution
Please feel free to contact for any bugs/updates.## Licence
[MIT](http://opensource.org/licences/MIT)Erdem Bircan (c) 2019-present