Skip to content

wbenevides/star-wars-api

Repository files navigation

Start Wars Planet API

How to run the application

  1. Clone the application with git clone https://github.com/wallacebenevides/star-wars-api.git

  2. To run the application with Makefile, please use the following command:

        make
    

Note: By default the port number its being run on is 8080.

  1. To stop the application, please use the following command:

        make stop
    

Endpoints Description

Get All Planets

    URL - *localhost:8080/api/planets*
    Method - GET

Get Planet By ID

    URL - *localhost:8080/api/planets/{id}*
    Method - GET

Get Planet By Name

    URL - *localhost:8080/api/planets/findByName?name={name}*
    Method - GET

Create Planet

    URL - *localhost:8080/api/planets*
    Method - POST
    Body - (content-type = application/json)
    {
    "name": "Haruun Kal",
    "climate": "temperate",
    "terrain": "toxic cloudsea, plateaus, volcanoes",
    "films": 0
}

Delete Planet

    URL - *localhost:8080/api/planets*
    Method - DELETE
    Body - (content-type = application/json)
    {
    "id": "..."
}

Test Driven Development Description

To run all the unit test cases, please use the following command:

make test

Hope everything works. Thank you.

About

Challenge CRUD REST API with Go and MongoDB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages