Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/lucasdants/nodejs-bethehero

BeTheHero is a project developed during the Semana Omnistack presented by Rockeseat. This project is a way to help ONGS.
https://github.com/lucasdants/nodejs-bethehero

celebrate cors express jest knex sqlite3 supertest typescript

Last synced: about 1 month ago
JSON representation

BeTheHero is a project developed during the Semana Omnistack presented by Rockeseat. This project is a way to help ONGS.

Awesome Lists containing this project

README

        





:trophy: BeTheHero API :trophy:

BeTheHero is a Restfull API of BeTheHero Web and BeTheHero Mobile


Express Version
Cors Version
Knex Version
Sqlite3 Version
Celebrate Version
Typescript Version
Jest Version
Supertest Version

:memo:About


BeTheHero API is a project developed during the Semana Omnistack 11 presented by Rockeseat.


WEB: BeTheHero Web


API: BeTheHero Mobile

:rocket: Getting started

```bash

# Clone this repository
$ git clone https://github.com/Luksdantas/NodeJS-BeTheHero.git

# Access the project folder cmd/terminal
$ cd NodeJS-NPS

# install the dependencies
$ npm install

# Run the application in development mode
$ npm run dev

# The application will open on the port: 3333 - go to http://localhost:3333

```

🛠 BeTheHero API


Insomnia document

POST Create Ong


Request

`POST /ongs`

```
{
"name": "Example Ong",
"email": "[email protected]",
"whatsapp": "85900000000",
"city": "São Paulo",
"uf": "SP"
}
```

Response

```
{
"id": "8035bc1a"
}
```

GET Ongs


Request

`GET /ongs`

Response

```
[
{
"id": "8035bc1a",
"name": "Example Ong",
"email": "[email protected]",
"whatsapp": "85900000000",
"city": "São Paulo",
"uf": "SP"
}
]
```

POST Login


Request

`POST /sessions`

```
{
"id": "8035bc1a"
}
```

Response

```
{
"name": "Example Ong"
}
```

GET Ong Profile


Request

`GET /profile headers: {authorization: 8035bc1a}`

Response

```
[
{
"id": 3,
"title": "Example incident",
"description": "Example description incident",
"value": 10,
"ong_id": "8035bc1a"
}
]
```

GET Incidents


Request

`GET /incidents`

Response

```
[
{
"id": 3,
"title": "Example incident",
"description": "Example description incident",
"value": 10,
"ong_id": "8035bc1a",
"name": "Example Ong",
"email": "[email protected]",
"whatsapp": "85900000000",
"city": "São Paulo",
"uf": "SP"
}
]
```

POST Create Incident


Request

`POST /incidents headers: {authorization: 8035bc1a}`

```
{
"title": "Example incident",
"description": "Example description incident",
"value": 10.00
}
```

Response

```
{
"id": 3
}
```

Delete Incident


Request

`DELETE /incidents/:id`

Response

```
```

:bookmark_tabs: License


License

Made with :heart: by Lucas Dantas 👋🏽 Get in Touch!