1.0.0 • Published 6 years ago

restocat-watcher v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

Restocat Watcher

Build Status

Installation

npm i restocat-watcher

How to use

In server.js file

    const Restocat = require('restocat');
    const Watcher = require('restocat-watcher');
    const rest = new Restocat();
    const server = rest.createServer();

    const watcher = new Watcher(rest.locator);

    server.listen(3000)
      .then(() => logger.info('Restocat listen on 3000 port'))
      .then(() => {
        if (process.env.NODE_ENV !== 'production') {
            watcher.watchCollections();
        }
      })
      .catch(reason => console.error(reason));