Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/lucasgabrieldeaa/bth-backend


https://github.com/lucasgabrieldeaa/bth-backend

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

        

# bth-backend

This API uses some nice features. Take a look on each one.

- [nodemon](https://nodemon.io/gdsf)
- [SQLite](https://www.sqlite.org/)
- [Knex](http://knexjs.org/)
- [Celebrate](https://github.com/arb/celebrate)

# Installing the application

```
yarn install
npm install
```

# Database

```
npx knex migrate:latest
```

# Starting the application

```
yarn start
npm start
```

# API's endpoints

```
Incidents

GET - /incidents?page=page - Retrieve all incidents in the database. Paginated.
GET - /incidents/ong - Retrieve all incidents by the ONG's authentication token sent on request's header information.
POST - /incidents - Create a new incident for the ONG with the authentication token sent on request's header information and return the Incident's ID.
DELETE - /indicents/:id - Delete the incident with the ID's information sent on request's param, and the ONG's authentication token sent on request's header.

ONG's

GET - /ongs - Retrieve all the ongs in the database.
POST - /ongs - Create a new ong and return the ONG's authentication token.

Session

POST - /sessions - Authenticate the ong with the token sent.
```