Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raphaelkieling/trello-report

:sheep: Report errors in express to trello.
https://github.com/raphaelkieling/trello-report

Last synced: 2 days ago
JSON representation

:sheep: Report errors in express to trello.

Awesome Lists containing this project

README

        

# Trello Report

Report messages to trello!

![Travis CI](https://travis-ci.org/raphaelkieling/trello-report.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/raphaelkieling/trello-report/badge.svg?branch=master)](https://coveralls.io/github/raphaelkieling/trello-report?branch=master)

## Installation

With **npm**

```sh
npm install --save trello-report-js
```

With **yarn**

```sh
yarn add --exact trello-report-js
```

## Example with middleware and function createCard

```javascript
const server = require("express")();
const trelloReport = require("../lib/trello_report");

let trelloReportMiddleware = new trelloReport({
your_key: "YOUR_KEY",
token: "YOUR_TOKEN",
id_list: "ID_LIST"
});

server.get("", async (req, res) => {
try {
throw new Error("Server error");
} catch (e) {
trelloReportMiddleware
.createCard("Erro no get do software")
.then(console.log("Card sended"));

res.status(500).send("ERROR");
}
});

server.use(trelloReportMiddleware.middleware());

server.listen(3000, () => console.log("listen in 3000"));
```

## Test

```sh
npm test
```

Precommit always run npm test. **Test your code**.