Skip to content

LucasDants/NodeJS-BeTheHero

Repository files navigation

🏆 BeTheHero API 🏆

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

📝About

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

WEB: BeTheHero Web

API: BeTheHero Mobile

🚀 Getting started

# 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": "example@example.com",
	"whatsapp": "85900000000",
	"city": "São Paulo",
	 "uf": "SP"
}

Response

{
  "id": "8035bc1a"
}

GET Ongs

Request

GET /ongs

Response

[
  {
    "id": "8035bc1a",
    "name": "Example Ong",
    "email": "example@example.com",
    "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": "example@example.com",
    "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

📑 License

License

Made with ❤️ by Lucas Dantas 👋🏽 Get in Touch!

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published