Skip to content

automatic client side reload to reflect server side changes

License

Notifications You must be signed in to change notification settings

erdembircan/source-reload

Repository files navigation

🔄 source-reload Build Status Coverage Status

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
        • 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

Erdem Bircan (c) 2019-present

About

automatic client side reload to reflect server side changes

Resources

License

Stars

Watchers

Forks

Packages

No packages published