0.5.3 • Published 4 years ago

tiger-server v0.5.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

tiger-server

Tiger server is a very lightweight server for very simple process like webhooks.

Usage

npm install tiger-server --save

and create server.js:

const { Tiger, http, cron, mail } = require("tiger-server")

const tiger = new Tiger({});

tiger.use(http)
tiger.use(cron)

tiger.use(mail)

tiger.define({ id: "hello", target: "zmq:hello", process: function (state, message) {
  tiger.log(`Message received: ${JSON.stringify(message)}`)
}})


tiger.define({ id: "cron", target: "cron:*/5 * * * * *", process: function ({ count = 0 }) {
  count++;
  tiger.notify("zmq:hello", { count })
  return { count }
}});

tiger.define({ id: "request", target: "http:/hello", process: function (state, { req, res }) {
  tiger.notify("zmq:hello", { message: "request recieved" });

  res.send("success!")
}})

tiger.serve();

Just run node server.js then you can now see these modules interactions.

Logo is generated from Wikipedia, the original script is under GPL license.

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

6 years ago

0.1.2

6 years ago

0.1.0

6 years ago