Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasgabrieldeaa/bth-backend
https://github.com/lucasgabrieldeaa/bth-backend
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lucasgabrieldeaa/bth-backend
- Owner: lucasGabrielDeAA
- Created: 2020-03-23T13:44:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T02:09:17.000Z (almost 2 years ago)
- Last Synced: 2023-08-05T02:40:58.813Z (over 1 year ago)
- Language: JavaScript
- Size: 564 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
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
```
IncidentsGET - /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.
```