0.0.7 • Published 7 years ago
api-notification v0.0.7
Installation process
To get started, you can simply clone this repository and install the dependencies:
Prerequisites
1. Git
You must have GIT to clone this repository:
sudo apt-get update
sudo apt-get install git
2. Node.js and Npm
You must have node.js and its package manager (npm) installed.
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
Install dependencies
We get the tools we depend upon via npm
. And install
npm install
Run application
The simplest way to start this server is to use PM2 (Process Manager):
sudo npm install pm2 -g
After install PM2:
npm run start-dev
Now browse to the app at http://localhost:2000
.
Deployment in production
sudo npm start
or
pm2 startOrRestart ecosystem.config.js
pm2 save
Using
Send POST to:
http://<IP>:2000/notifications
with:
Headers:
Authorization: Basic YnVzY2E6d2Vsc2preQ==
Body:
to:lourivaldo.vasconcelos@mangue3.com
site:www.buscaaero.com.br
description:Descricao do ocorrido
url:https://www.buscaaero.com.br/busca
type:error
title:Titulo do email
###Description:
Header:
"Authorization" with base62 from user:email like "loro:sfddf"
Body:
to: Email to send notification. Not required, if not passed email from authenticated user will be used
description: Description of notification. Required.
url: An URL from site where notification sent. Optional.
type: Type of notification like 'info', 'warning' or 'error'. Optional, default "info".
title: An title/subject to notification. Optional, default "Notification".