A demo of Notification Framework integration to a NodeJS/Express application
-
Clone the Git repository:
git clone https://github.com/Jhotika/notification-framework
-
Install the dependencies using npm:
npm install
or yarn:
yarn install
-
Start the express server:
npm start
or
yarn start
-
Open the browser and navigate to
http://localhost:8000/to see the application in action.
Fetches all notifications for a user.
- Method: GET
- Response: Returns a JSON object containing an array of notification responses.
- Error Handling: Returns a 500 status code if fetching notifications fails.
Sends a new notification.
- Method: POST
- Action: Performs an action and sends a notification using YoService.
- Response: Returns a JSON object with a success message.
- Error Handling: Returns a 500 status code if sending the notification fails.
Marks all notifications as read for the current user.
- Method: POST
- Action: Marks all notifications as read using the notification service.
- Response: Returns a JSON object indicating success.
- Error Handling: Returns a 500 status code if marking notifications as read fails.
Marks a specific notification as read.
- Method: POST
- Parameters:
uuid- The unique identifier of the notification to mark as read. - Action: Marks the specified notification as read using YoService.
- Response: Returns a JSON object with a success message.
- Error Handling: Returns a 500 status code if marking the notification as read fails.