1.0.12 • Published 2 years ago

ehsmsgqueue v1.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

End House Software Message Queue Module

End House Software Message Queue Module.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

The message queue module uses a MongoDB database to store data. You can create a MongoDB database by creating an account on Atlas.

In ehsmsgqueue.js you must edit the following source code line,

var uri = "mongodb+srv://username:password@ehs0-ncww2.mongodb.net/dbname";

to reflect the database name, user name and password.

To run locally you need the NodeJS software installed (the npm package manager is bundled with NodeJS).

To edit source code, right-click on project's directoy, e.g ehsmsgqueue and select Open with Code menu option.

Deployment

Install message queue module in project ...

npm install --save ehsmsgqueue

and then ...

(a) Define Message Queue Variable

var mqueue = require('ehsmsgqueue');

(b) Init Message Queue

mqueue.initMsgQueues( msgQueueName, username, 
	function(err, result){ 
});

(c) Get a Message From the Queue

router.post('/getmsg', function(req, res) {
  var msgQueueName = req.body.msgqueue;
  var username = req.body.username;

  mqueue.getMsg(msgQueueName,username,function(err, result){
res.send(result);
  });
});

(d) Set a Message in the Queue

router.post('/setmsg', function(req, res) {
  var msgQueueName = req.body.msgqueue;
  var msg = req.body.msg;
  
  mqueue.setMsg(msgQueueName,msg,function(err, result){
  });

  res.send("");
});

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

First and foremost many thanks to the support of family and friends. Any code adapted from public available sources have the appropriate acknowledgements documented in source code comments.

1.0.12

2 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago