source-reload
v1.0.2
Published
client side browser reloader for server side changes
Downloads
3
Maintainers
Readme
🔄 source-reload
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.
# 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
- type:
res
: response object- type:
object
- type:
- type:
SourceReloadClient
: Frontend client- type:
function
- arguments:
url
: url adress for backend stream connection- type:
string
- type:
- type:
Contribution
Please feel free to contact for any bugs/updates.
Licence
Erdem Bircan (c) 2019-present