Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/lucasdants/nodejs-bethehero
- Owner: LucasDants
- License: mit
- Created: 2021-03-06T18:22:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-05T19:59:40.000Z (over 3 years ago)
- Last Synced: 2024-04-28T06:01:57.361Z (8 months ago)
- Topics: celebrate, cors, express, jest, knex, sqlite3, supertest, typescript
- Language: TypeScript
- Homepage:
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
:trophy: BeTheHero API :trophy:BeTheHero is a Restfull API of BeTheHero Web and BeTheHero Mobile
: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 documentPOST 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
Made with :heart: by Lucas Dantas 👋🏽 Get in Touch!