Skip to content

isunnyjaiswal/PubSubNodeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PubSubNodeJS

Following up on my last project of serving Random Quotes using NodeJS with a MongoDB, this repository uses the randomQuotes and serves on the publisher and subscriber model.

The eventemitter.js files emits the event 'givemerandomquote' and when you run the events.js file, it receives the emit and catches the random quote as an argument.

In this project too, you will be required to import Mongoose and Mongoose Random.

Mongoose: Mongoose is what we will use to interact with a MongoDB(Database) instance. npm install mongoose --save

Mongoose Random: Used to choose the random document from the chosen mongoose collection. npm install mongoose-random

Below are some details, change as per your need: Mongo Database Name used: quoteGeneratorDB Collection Name: quotes Collection structure: quote(String), author(String), quotetype(enum['love', 'inspirational', 'patriotic'])

About

The app gives randomQuotes whenever an event is triggered.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published