starwars-api-go

command module
v0.0.0-...-0405c2d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 9 Imported by: 0

README

Star Wars API

🚀 STAR WARS API 🚀

Projeto | Tecnologias | Pré-requisitos | Features | Como executar | Endpoints | Author | Licença

GitHub language count Repository size License Stars

💻 Projeto

Este é um projeto para proporcionar dados de Planetas da saga StarWars.

🛠️ Tecnologias

🧩 Pré-requisitos

Antes de executá-lo, é necessário ter instalado em sua máquina:

📝 Features

  • Criar um planeta com Nome, Clima e Terreno.
  • Buscar em API externa (https://swapi.dev/api/planets) a quantidade de aparições do respectivo planeta.
  • Listar todos os planetas.
  • Buscar um planeta por ID.
  • Buscar um planeta por Nome.
  • Remover um planeta.

⚙️ Como executar

$ git clone https://github.com/flpzow/starwars-api-go
$ cd starwars-api-go

Para iniciá-lo, siga os passos abaixo:

# O projeto sobe aplicação e banco de dados em conteiners Docker.
$ docker-compose up --build
# Para verificar os logs, execute:
$ docker logs nome-do-container

🎯 Endpoints

  • CREATE PLANET - /planets (POST)
  • LIST PLANETS - /planets (GET)
  • GET PLANET BY ID - /planets/{planetId}" (GET)
  • GET PLANET BY NAME - /planets?search={name} (GET)
  • REMOVE PLANET - /planets/{planetId}" (DELETE)

Exemplo de Payload:

 {

    "name":"Tatooine",
    "climate":"arid",
    "terrain":"desert"
  }

Exemplo de Requisição:

curl -X POST \
  http://localhost:8080/planets \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
	"name":"Tatooine",
	"climate":"arid",
	"terrain":"desert"
}'

✏️ Author

Vinícius Neto

📝 License

Esse projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL