# api-notification

> Api to notify actions and errors

Latest version **0.0.7** (published 2017-09-15) · 0 weekly downloads

## Install

```sh
npm install api-notification
pnpm add api-notification
yarn add api-notification
bun add api-notification
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2017-09-15 |
| First published | 2017-09-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Known vulnerabilities | 0 (+21 in 4 direct dependencies) |
| Install scripts | no |
| Author | Lourivaldo Vasconcelos |
| Maintainers | mangue3 |

## Links

- npm: https://www.npmjs.com/package/api-notification
- npm.io page: https://npm.io/package/api-notification

## Dependencies (14)

- [cors](https://npm.io/package/cors.md) ^2.8.4
- [jade](https://npm.io/package/jade.md) ~1.11.0
- [debug](https://npm.io/package/debug.md) ~2.6.3
- [config](https://npm.io/package/config.md) ^1.26.2
- [morgan](https://npm.io/package/morgan.md) ~1.8.1
- [stylus](https://npm.io/package/stylus.md) 0.54.5
- [express](https://npm.io/package/express.md) ~4.15.2
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^4.1.0
- [body-parser](https://npm.io/package/body-parser.md) ~1.17.1
- [cookie-parser](https://npm.io/package/cookie-parser.md) ~1.4.3
- [serve-favicon](https://npm.io/package/serve-favicon.md) ~2.4.2
- [express-basic-auth](https://npm.io/package/express-basic-auth.md) ^1.1.2
- [nodemailer-ses-transport](https://npm.io/package/nodemailer-ses-transport.md) ^1.5.1

## Recent versions

- 0.0.7 (latest) — 2017-09-15
- 0.0.6 — 2017-09-14
- 0.0.4 — 2017-09-14
- 0.0.3 — 2017-09-14
- 0.0.2 — 2017-09-14
- 0.0.1 — 2017-09-14

## README

![alt tag](http://ctnovatec.com.br/wp-content/uploads/2015/03/nodejs-logo.png)

## 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".
```

---
_Source: https://npm.io/package/api-notification · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
